Autoinstall with apt deb822 source on noble does not override '/etc/apt/sources.list.d/ubuntu.sources' despite 'preserve_sources_list: false'

Bug #2070320 reported by Ryan Stewart
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
subiquity (Ubuntu)
Triaged
High
Chris Peterson

Bug Description

When using the following apt section on autoinstall, it does not replace the existing ubuntu sources despite the preserve_sources_list variable being set to false. It does appear to replace /etc/apt/sources.list, but this file is no longer used in Ubuntu 24.04.

======
apt:
  preserve_sources_list: false
  fallback: abort
  geoip: false
  sources:
    landscape.sources:
      source: |
        Types: deb
        URIs: http://landscape.home/repository/standalone/ubuntu/
        Suites: noble noble-updates noble-security
        Components: main universe restricted multiverse
        Signed-By: 16234E77E46C9DE644E1F4F4DA787C193976C85B
        Architectures: amd64
      key: |
        -----BEGIN PGP PUBLIC KEY BLOCK-----
        ...
        -----END PGP PUBLIC KEY BLOCK-----
======

What ends up happening is the system will install from the Landscape mirror, but the other sources are not removed.

Revision history for this message
Ryan Stewart (stew3254) wrote :

It looks like if you set the source to ubuntu.sources it will append to the file, but not overwrite it. I haven't found a way using the apt module to delete the file. I could use a late-command on the target system, but other versions of Ubuntu don't require this work around.

Revision history for this message
Chris Peterson (cpete) wrote :

Hi Ryan, thanks for your report.

Just to clarify the issue: When setting "preserve_sources_list: false" it would effectively cause the target's /etc/apt/sources.list file to be updated with only the config provided via Curtin, correct? Now, we only ever get additive behavior?

Reading through the Curtin documentation, the intended behavior of the preserve_sources_list flag combined with .sources entries is unclear to me. I wonder if the effect of "preserve_sources_list: false" previously was to simply clear the sources.list file, instead of "updating" it.

Changed in subiquity:
status: New → Triaged
importance: Undecided → Medium
Chris Peterson (cpete)
affects: subiquity → subiquity (Ubuntu)
Changed in subiquity (Ubuntu):
assignee: nobody → Chris Peterson (cpete)
importance: Medium → High
tags: added: foundations-todo
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.