#1115854 python3-apt: creates /etc/apt/sources.list post-migration

Package:
python3-apt
Source:
python3-apt
Description:
Python 3 interface to libapt-pkg
Submitter:
Thorsten Glaser
Date:
2025-12-01 19:59:01 UTC
Severity:
normal
#1115854#5
Date:
2025-09-20 16:08:30 UTC
From:
To:
Considering that apt, as of a few weeks before the trixie release,
has complained *LOUDLY* about the sources.list format (this seems
to have quietened for the actual release), people are migrating to
the deb822-sources format.

However, the command “unattended-upgrade --download-only”, as run
by /usr/lib/systemd/system/apt-daily.service, creates a sources.list
file if deleted (i.e. the transition has finished). It should not
do that.

(I’ve not traced what precisely within it creates it, only traced
this far with “sh -x”, as u-u is Python3 and thus harder to trace.)

It also should not do that because this is basically overriding the
local admin’s choice (recreating a conffile the admin deleted), and
it’s annoying in ansible output when the latter is deleting the same
file over and over again and people wonder what’s changed…

Please fix this and bring the fix into a point release of trixie.

#1115854#18
Date:
2025-12-01 19:51:31 UTC
From:
To:
retitle 1115854 python3-apt: creates /etc/apt/sources.list post-migration
reassign 1115854 python3-apt
found 1115854 3.0.0
thanks

I’ve now traced this down to just:

root@trixie:~# python3
Python 3.13.5 (main, Jun 25 2025, 18:55:22) [GCC 14.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
<apt.cache.Cache object at 0x7f00db201160>

This is sufficient to create an empty /etc/apt/sources.list which
causes Ansible to perpetually change things and which will cause
apt to, eventually, complain about its existence again.

Thanks in advance,
//Thorsten