[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1121878: Default::Packages::Compress=zstd does not work (Packges.zst without Packages is ignored)



Package: apt
Version: 3.1.12
Severity: minor

If an InRelease file lists Packages and Packages.zst, then
apt will download Packages.zst (good, normal).

If an InRelease File lists only Packages.zst, then
apt will silently ignore it and exit successfully.
This results in "apt update" appearing to work, but
none of the packages in the repo are available.

An attached transcript demonstrates the problem on sid.

This issue affects apt 3.1.12 (current sid) as at December 2025.
This issue affects apt 3.0.3 (current stable) as at December 2025.
This issue affects apt 1.8.4 (using xz instead of zst) as at February 2020.
This issue affects apt 1.4.9 (using xz instead of zst) as at February 2020.

I couldn't immediately work out where in the apt source code this issue is happening.
Is this intended behaviour, or a logic bug?
I speculate the current logic might be something like

    for each Packages (no suffix) in Release
        if it is for our architecture
            get url of best available compression
            download that url

and since there's no Packages (without suffix), the loop never runs at all.

It is not a big deal for me to continue doing

    Default::Packages::Compress    ". zstd";
    Default::Sources::Compress     ". zstd";
    Default::Contents::Compress    ". zstd";
    Default::Translation::Compress ". zstd";

instead of

    Default::Packages::Compress    "zstd";
    Default::Sources::Compress     "zstd";
    Default::Contents::Compress    "zstd";
    Default::Translation::Compress "zstd";

it is just confusing/irritating that Packages has to exist,
even though nothing ever downloads it.
twb@heavy:~$ mmdebstrap --quiet sid /dev/null /etc/apt/sources.list.d/cyber.sources 'deb https://deb.debian.org/debian unstable main' --include=ca-certificates --customize-hook='env -i TERM=screen PATH=/bin:/sbin chroot $1 bash; false'
root@heavy:/# apt --version

apt 3.1.12 (amd64)
root@heavy:/# apt update

Hit:1 https://apt.cyber.com.au/cyber trixie InRelease
Hit:2 https://deb.debian.org/debian unstable InRelease
All packages are up to date.
Notice: Some sources can be modernized. Run 'apt modernize-sources' to do so.
root@heavy:/# cd /var/lib/apt/lists

root@heavy:/var/lib/apt/lists# apt modernize-sources

The following files need modernizing:
  - /etc/apt/sources.list.d/0001main.list

Modernizing will replace .list files with the new .sources format,
add Signed-By values where they can be determined automatically,
and save the old files into .list.bak files.

This command supports the 'signed-by' and 'trusted' options. If you
have specified other options inside [] brackets, please transfer them
manually to the output files; see sources.list(5) for a mapping.

For a simulation, respond N in the following prompt.
Rewrite 1 sources? [Y/n] 
Modernizing /etc/apt/sources.list.d/0001main.list...
- Writing /etc/apt/sources.list.d/0001main.sources

root@heavy:/var/lib/apt/lists# rm *_*

root@heavy:/var/lib/apt/lists# apt update -o Debug::Acquire::Transaction=1

New pkgAcqMetaIndex with TransactionManager 0x5609d98054d0
New pkgAcqMetaIndex with TransactionManager 0x5609d9805930
Get:1 https://apt.cyber.com.au/cyber trixie InRelease [1049 B]
Get:2 https://deb.debian.org/debian unstable InRelease [176 kB]
0% [Working]New pkgIndex with TransactionManager 0x5609d9805930
Get:3 https://deb.debian.org/debian unstable/main amd64 Packages [10.2 MB]
Fetched 10.4 MB in 3s (3416 kB/s)
Finished: /var/lib/apt/lists/apt.cyber.com.au_cyber_dists_trixie_InRelease
CommitTransaction: 0x5609d98054d0
mv /var/lib/apt/lists/partial/apt.cyber.com.au_cyber_dists_trixie_InRelease -> /var/lib/apt/lists/apt.cyber.com.au_cyber_dists_trixie_InRelease # https://apt.cyber.com.au/cyber/dists/trixie/InRelease
rm /var/lib/apt/lists/apt.cyber.com.au_cyber_dists_trixie_main_binary-all_Packages # https://apt.cyber.com.au/cyber/dists/trixie/main/binary-all/Packages
rm /var/lib/apt/lists/apt.cyber.com.au_cyber_dists_trixie_main_binary-amd64_Packages # https://apt.cyber.com.au/cyber/dists/trixie/main/binary-amd64/Packages
Finished: /var/lib/apt/lists/deb.debian.org_debian_dists_unstable_InRelease
CommitTransaction: 0x5609d9805930
mv /var/lib/apt/lists/partial/deb.debian.org_debian_dists_unstable_InRelease -> /var/lib/apt/lists/deb.debian.org_debian_dists_unstable_InRelease # https://deb.debian.org/debian/dists/unstable/InRelease
mv /var/lib/apt/lists/partial/deb.debian.org_debian_dists_unstable_main_binary-amd64_Packages -> /var/lib/apt/lists/deb.debian.org_debian_dists_unstable_main_binary-amd64_Packages # store:/var/lib/apt/lists/partial/deb.debian.org_debian_dists_unstable_main_binary-amd64_Packages.xz
rm /var/lib/apt/lists/deb.debian.org_debian_dists_unstable_main_binary-all_Packages # https://deb.debian.org/debian/dists/unstable/main/binary-all/Packages
All packages are up to date.
root@heavy:/var/lib/apt/lists# ls -1

apt.cyber.com.au_cyber_dists_trixie_InRelease
auxfiles
deb.debian.org_debian_dists_unstable_InRelease
deb.debian.org_debian_dists_unstable_main_binary-amd64_Packages
lock
partial
root@heavy:/var/lib/apt/lists# # Where is cyber Packages?

root@heavy:/var/lib/apt/lists# cat apt.cyber.com.au_cyber_dists_trixie_InRelease

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Acquire-By-Hash: yes
Architectures: amd64
ButAutomaticUpgrades: yes
Codename: trixie
Components: main
Date: Thu, 04 Dec 2025 03:16:30 +0000
Label: Cyber
NotAutomatic: yes
Origin: Cyber
Suite: trixie
Valid-Until: Thu, 01 Jan 2026 03:16:30 +0000
SHA512:
 c9be43e75039d2b4f26df6e3648156bb1f1ae80ff539563e36fd681219e4026a715107697310319962a479c9112161ee0212f5d5a153215b4d6a74c1f5945d8d             7607 main/Contents-amd64.zst
 01340b3ef4a716618648b912a81dcafec5f3c50a7c77f75225dc2f5d62f67489e28a55ac8337841ce0b27f94e7eaeda86fce374f3de926a8829143013af83180             8934 main/binary-amd64/Packages.zst
 21c3b351c0a7606f51e1c5f546e0be2b4f7d2f1a0aeff59839c814d892727318f8ea6164745ccc4ab6b5392e7b39437ec2de44ac09e482bb1df0835712e49fbc             2382 main/source/Sources.zst
-----BEGIN PGP SIGNATURE-----

iHUEARYKAB0WIQQQeY1Rs6jMj5F1+xhdWVKNhyqzJgUCaTD9DgAKCRBdWVKNhyqz
JhwWAP4kEzSnt4EkHqppgkYCoGynNlFEJgY4h4N+J/WHOykolAEAwUSzSHPmgf93
8Eogo6nRiw+7I53hlK/PWxT2BbxY4AM=
=BAwh
-----END PGP SIGNATURE-----
root@heavy:/var/lib/apt/lists# # now I will rebuild that apt repo with Default::Packages::Compress ". zstd"; (instead of only "zstd")

root@heavy:/var/lib/apt/lists# rm *_*

root@heavy:/var/lib/apt/lists# apt update -o Debug::Acquire::Transaction=1

New pkgAcqMetaIndex with TransactionManager 0x55eb6210f4d0
New pkgAcqMetaIndex with TransactionManager 0x55eb6210f930
Get:1 https://apt.cyber.com.au/cyber trixie InRelease [1223 B]
0% [Connected to debian.map.fastly.net (151.101.82.132)]New pkgIndex with TransactionManager 0x55eb6210f4d0
Get:2 https://apt.cyber.com.au/cyber trixie/main amd64 Packages [8934 B]
Get:3 https://deb.debian.org/debian unstable InRelease [176 kB]
0% [Working]New pkgIndex with TransactionManager 0x55eb6210f930
Get:4 https://deb.debian.org/debian unstable/main amd64 Packages [10.2 MB]
Fetched 10.4 MB in 3s (3411 kB/s)
Finished: /var/lib/apt/lists/apt.cyber.com.au_cyber_dists_trixie_InRelease
CommitTransaction: 0x55eb6210f4d0
mv /var/lib/apt/lists/partial/apt.cyber.com.au_cyber_dists_trixie_InRelease -> /var/lib/apt/lists/apt.cyber.com.au_cyber_dists_trixie_InRelease # https://apt.cyber.com.au/cyber/dists/trixie/InRelease
rm /var/lib/apt/lists/apt.cyber.com.au_cyber_dists_trixie_main_binary-all_Packages # https://apt.cyber.com.au/cyber/dists/trixie/main/binary-all/Packages
mv /var/lib/apt/lists/partial/apt.cyber.com.au_cyber_dists_trixie_main_binary-amd64_Packages -> /var/lib/apt/lists/apt.cyber.com.au_cyber_dists_trixie_main_binary-amd64_Packages # store:/var/lib/apt/lists/partial/apt.cyber.com.au_cyber_dists_trixie_main_binary-amd64_Packages.zst
Finished: /var/lib/apt/lists/deb.debian.org_debian_dists_unstable_InRelease
CommitTransaction: 0x55eb6210f930
mv /var/lib/apt/lists/partial/deb.debian.org_debian_dists_unstable_InRelease -> /var/lib/apt/lists/deb.debian.org_debian_dists_unstable_InRelease # https://deb.debian.org/debian/dists/unstable/InRelease
rm /var/lib/apt/lists/deb.debian.org_debian_dists_unstable_main_binary-all_Packages # https://deb.debian.org/debian/dists/unstable/main/binary-all/Packages
mv /var/lib/apt/lists/partial/deb.debian.org_debian_dists_unstable_main_binary-amd64_Packages -> /var/lib/apt/lists/deb.debian.org_debian_dists_unstable_main_binary-amd64_Packages # store:/var/lib/apt/lists/partial/deb.debian.org_debian_dists_unstable_main_binary-amd64_Packages.xz
All packages are up to date.
root@heavy:/var/lib/apt/lists# ls -1

apt.cyber.com.au_cyber_dists_trixie_InRelease
apt.cyber.com.au_cyber_dists_trixie_main_binary-amd64_Packages
auxfiles
deb.debian.org_debian_dists_unstable_InRelease
deb.debian.org_debian_dists_unstable_main_binary-amd64_Packages
lock
partial
root@heavy:/var/lib/apt/lists# cat apt.cyber.com.au_cyber_dists_trixie_InRelease

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Acquire-By-Hash: yes
Architectures: amd64
ButAutomaticUpgrades: yes
Codename: trixie
Components: main
Date: Thu, 04 Dec 2025 03:18:48 +0000
Label: Cyber
NotAutomatic: yes
Origin: Cyber
Suite: trixie
Valid-Until: Thu, 01 Jan 2026 03:18:48 +0000
SHA512:
 c9be43e75039d2b4f26df6e3648156bb1f1ae80ff539563e36fd681219e4026a715107697310319962a479c9112161ee0212f5d5a153215b4d6a74c1f5945d8d             7607 main/Contents-amd64.zst
 c7ee8d0019bcea9422e565986a8b8757391b5c4da179ef43579ec5dab01f9481adfae8ff0f19f62b42c4a834eab4bc8e1f8eb76f208d25e9ca0a9940275c36b6            34780 main/binary-amd64/Packages
 01340b3ef4a716618648b912a81dcafec5f3c50a7c77f75225dc2f5d62f67489e28a55ac8337841ce0b27f94e7eaeda86fce374f3de926a8829143013af83180             8934 main/binary-amd64/Packages.zst
 21c3b351c0a7606f51e1c5f546e0be2b4f7d2f1a0aeff59839c814d892727318f8ea6164745ccc4ab6b5392e7b39437ec2de44ac09e482bb1df0835712e49fbc             2382 main/source/Sources.zst
-----BEGIN PGP SIGNATURE-----

iHUEARYKAB0WIQQQeY1Rs6jMj5F1+xhdWVKNhyqzJgUCaTD9mAAKCRBdWVKNhyqz
JlZxAP9RbXpzx/7kWvhgPnxNxnXEIt1zukIlRX5tu1D5cIczTQEAmYaP40L0/9nY
2rEGgMVGvT7b5+mms2/4zfymC3Mu4QA=
=Z/Fq
-----END PGP SIGNATURE-----
root@heavy:/var/lib/apt/lists# # with only Packages.zst in the manifest it was silently ignored

root@heavy:/var/lib/apt/lists# # with Packages and Packages.zst in the manifest, Packages.zst is downloaded correctly (per the store: debug line)

root@heavy:/var/lib/apt/lists# exit

Reply to: