Description
The Debian 11 (bullseye) backports repository has been deprecated, but cloud-init continues to generate it in /etc/apt/sources.list when provisioning Debian 11 systems. This causes APT warnings and potential package installation issues.
For example, Debian 12 'bookworm' was released on June 10th 2023, so bullseye-backports for Debian 11 'bullseye' was closed on June 10th 2024.
Steps to Reproduce
- Deploy a Debian 11 (bullseye) instance using cloud-init
- Check
/etc/apt/sources.list
- Observe that
bullseye-backports repository is included
Current Behavior
The template /etc/cloud/templates/sources.list.debian.tmpl generates backports repository for all Debian versions including bullseye:
deb http://deb.debian.org/debian bullseye-backports main
deb-src http://deb.debian.org/debian bullseye-backports main
Expected Behavior
Debian 11 (bullseye) and later versions should NOT include the backports repository since it has been deprecated by the Debian project.
Proposed Fix
Modify templates/sources.list.debian.tmpl to conditionally exclude backports for Debian 11 (bullseye):
{% if codename != 'bullseye' %}deb {{mirror}} {{codename}}-backports main
{% endif %}{% if codename != 'bullseye' %}deb-src {{mirror}} {{codename}}-backports main
{% endif %}
Impact
- Affected versions: Debian 11 (bullseye)
- Unaffected versions: Debian 10 (buster) and earlier, Debian 12 (bookworm) and later
- Severity: Medium - causes APT warnings and repository errors
Additional Context
- Debian 11 backports repository was officially deprecated
- Users experience APT errors:
The repository 'http://deb.debian.org/debian bullseye-backports Release' does not have a Release file
- This affects all cloud-init deployments on Debian 11 that use the default apt configuration
Environment
- cloud-init version: 25.1.3
- Distribution: Debian 11 (bullseye)
- Template file:
templates/sources.list.debian.tmpl
Description
The Debian 11 (bullseye) backports repository has been deprecated, but cloud-init continues to generate it in
/etc/apt/sources.listwhen provisioning Debian 11 systems. This causes APT warnings and potential package installation issues.Steps to Reproduce
/etc/apt/sources.listbullseye-backportsrepository is includedCurrent Behavior
The template
/etc/cloud/templates/sources.list.debian.tmplgenerates backports repository for all Debian versions including bullseye:Expected Behavior
Debian 11 (bullseye) and later versions should NOT include the backports repository since it has been deprecated by the Debian project.
Proposed Fix
Modify
templates/sources.list.debian.tmplto conditionally exclude backports for Debian 11 (bullseye):Impact
Additional Context
The repository 'http://deb.debian.org/debian bullseye-backports Release' does not have a Release fileEnvironment
templates/sources.list.debian.tmpl