canonical / packer-maas

Packer templates to create MAAS deployable images
Other
285 stars 172 forks source link

Debian 11 not using correct apt sources #248

Open JamesHawkinss opened 3 months ago

JamesHawkinss commented 3 months ago

I have built the Debian 11 image and uploaded it to MAAS, and added the custom curtin userdata to the correct place in my MAAS install.

When deploying the Debian image to a machine, everything works except the apt sources are not correct. By default, without modifying any of the pre-supplied code, the /etc/apt/sources.list file contains the following:

## 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 http://deb.debian.org/debian bullseye main
deb-src http://deb.debian.org/debian bullseye main

## Major bug fix updates produced after the final release of the
## distribution.
deb http://security.debian.org bullseye/updates main
deb-src http://security.debian.org bullseye/updates main
deb http://deb.debian.org/debian bullseye-updates main
deb-src http://deb.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 http://deb.debian.org/debian bullseye-backports main
deb-src http://deb.debian.org/debian bullseye-backports main

Comparing with a normal Debian's sources.list, there are differences with the security.debian.org sources which prevents apt update from working properly.

Differences:

  1. security.debian.org should be security.debian.org/debian-security
  2. bullseye/updates after security should be bullseye-security

To fix the first difference, I was able to modify the curtin custom userdata late_3 command to change the sed target.

Despite modifying other curtin custom userdata commands, I have been unable to resolve the second difference.

github-actions[bot] commented 2 months ago

This issue is stale because it has been open for 30 days with no activity.

JamesHawkinss commented 1 month ago

Still an issue

github-actions[bot] commented 3 weeks ago

This issue is stale because it has been open for 30 days with no activity.