cloud-init setting apt.primary does not work on debian.bookworm
keestux opened this issue · 1 comments
keestux commented
First, I'm hoping that this is the right place to report this.
With LXD I have this config in a profile
config:
cloud-init.user-data: |
#cloud-config
write_files:
- content: |
Kees was here
path: /tmp/kees-was-here
apt:
primary:
- arches: [amd64, i386, default]
uri: https://myapt.example.com/archive.debian.org/debian
That works for Debian 10 and 11, but not for Debian 12 (bookworm)
An example to show what I mean.
First an example with Debian 11
$ lxc launch images:debian/11/cloud mir-deb11 --profile my-debian
Creating mir-deb11
Starting mir-deb11
$ lxc exec mir-deb11 -- ls -l /tmp/kees-was-here
-rw-r--r-- 1 root root 14 Aug 3 18:45 /tmp/kees-was-here
$ lxc exec mir-deb11 -- cat /etc/apt/sources.list
## Note, this file is written by cloud-init on first boot of an instance
## modifications made here will not survive a re-bundle.
## if you wish to make changes you can:
## a.) add 'apt_preserve_sources_list: true' to /etc/cloud/cloud.cfg
## or do the same in user-data
## b.) add sources in /etc/apt/sources.list.d
## c.) make changes to template file /etc/cloud/templates/sources.list.debian.tmpl
###
# See http://www.debian.org/releases/stable/i386/release-notes/ch-upgrading.html
# for how to upgrade to newer versions of the distribution.
deb https://myapt.example.com/archive.debian.org/debian bullseye main
deb-src https://myapt.example.com/archive.debian.org/debian bullseye main
## Major bug fix updates produced after the final release of the
## distribution.
deb https://myapt.example.com/archive.debian.org/debian bullseye/updates main
deb-src https://myapt.example.com/archive.debian.org/debian bullseye/updates main
deb https://myapt.example.com/archive.debian.org/debian bullseye-updates main
deb-src https://myapt.example.com/archive.debian.org/debian bullseye-updates main
## Uncomment the following two lines to add software from the 'backports'
## repository.
##
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
deb https://myapt.example.com/archive.debian.org/debian bullseye-backports main
deb-src https://myapt.example.com/archive.debian.org/debian bullseye-backports main
Now with Debian 12
$ lxc launch images:debian/12/cloud mir-deb12 --profile my-debian
Creating mir-deb12
Starting mir-deb12
$ lxc exec mir-deb12 -- ls -l /tmp/kees-was-here
-rw-r--r-- 1 root root 14 Aug 3 18:45 /tmp/kees-was-here
$ lxc exec mir-deb12 -- cat /etc/apt/sources.list
# Generated by distrobuilder
deb http://deb.debian.org/debian bookworm main
deb http://deb.debian.org/debian bookworm-updates main
deb http://deb.debian.org/debian-security/ bookworm-security main
keestux commented
Problem solved. See canonical/cloud-init#4605