Hello, welcome to the forum!
Outline wrote: ↑2024-02-01 15:18
if bookworm and bookworm-updates have the same priority, then the most recent should be picked, isn't it?
Yes it is. But that's not the case with your setup. You can check this with
apt policy:
Code: Select all
$> apt policy
Package files:
100 /var/lib/dpkg/status
release a=now
900 https://deb.debian.org/debian bookworm-updates/main amd64 Packages
release v=12-updates,o=Debian,a=stable-updates,n=bookworm-updates,l=Debian,c=main,b=amd64
origin deb.debian.org
500 https://deb.debian.org/debian-security bookworm-security/non-free-firmware amd64 Packages
release v=12,o=Debian,a=stable-security,n=bookworm-security,l=Debian-Security,c=non-free-firmware,b=amd64
origin deb.debian.org
500 https://deb.debian.org/debian-security bookworm-security/contrib amd64 Packages
release v=12,o=Debian,a=stable-security,n=bookworm-security,l=Debian-Security,c=contrib,b=amd64
origin deb.debian.org
500 https://deb.debian.org/debian-security bookworm-security/main amd64 Packages
release v=12,o=Debian,a=stable-security,n=bookworm-security,l=Debian-Security,c=main,b=amd64
origin deb.debian.org
500 https://deb.debian.org/debian bookworm/non-free-firmware amd64 Packages
release v=12.4,o=Debian,a=stable,n=bookworm,l=Debian,c=non-free-firmware,b=amd64
origin deb.debian.org
500 https://deb.debian.org/debian bookworm/non-free amd64 Packages
release v=12.4,o=Debian,a=stable,n=bookworm,l=Debian,c=non-free,b=amd64
origin deb.debian.org
500 https://deb.debian.org/debian bookworm/contrib amd64 Packages
release v=12.4,o=Debian,a=stable,n=bookworm,l=Debian,c=contrib,b=amd64
origin deb.debian.org
500 https://deb.debian.org/debian bookworm/main amd64 Packages
release v=12.4,o=Debian,a=stable,n=bookworm,l=Debian,c=main,b=amd64
origin deb.debian.org
Pinned packages:
$> apt policy linux-headers-amd64
linux-headers-amd64:
Installed: (none)
Candidate: 6.1.67-1
Version table:
6.1.69-1 500
500 https://deb.debian.org/debian-security bookworm-security/main amd64 Packages
6.1.67-1 900
900 https://deb.debian.org/debian bookworm-updates/main amd64 Packages
6.1.66-1 500
500 https://deb.debian.org/debian bookworm/main amd64 Packages
As you can see, only the last entry is taken into account.
You must use separate records:
Code: Select all
Package: *
Pin: release n=bookworm
Pin-Priority: 900
Package: *
Pin: release n=bookworm-security
Pin-Priority: 900
Package: *
Pin: release n=bookworm-updates
Pin-Priority: 900
Code: Select all
$> apt policy
Package files:
100 /var/lib/dpkg/status
release a=now
900 https://deb.debian.org/debian bookworm-updates/main amd64 Packages
release v=12-updates,o=Debian,a=stable-updates,n=bookworm-updates,l=Debian,c=main,b=amd64
origin deb.debian.org
900 https://deb.debian.org/debian-security bookworm-security/non-free-firmware amd64 Packages
release v=12,o=Debian,a=stable-security,n=bookworm-security,l=Debian-Security,c=non-free-firmware,b=amd64
origin deb.debian.org
900 https://deb.debian.org/debian-security bookworm-security/contrib amd64 Packages
release v=12,o=Debian,a=stable-security,n=bookworm-security,l=Debian-Security,c=contrib,b=amd64
origin deb.debian.org
900 https://deb.debian.org/debian-security bookworm-security/main amd64 Packages
release v=12,o=Debian,a=stable-security,n=bookworm-security,l=Debian-Security,c=main,b=amd64
origin deb.debian.org
900 https://deb.debian.org/debian bookworm/non-free-firmware amd64 Packages
release v=12.4,o=Debian,a=stable,n=bookworm,l=Debian,c=non-free-firmware,b=amd64
origin deb.debian.org
900 https://deb.debian.org/debian bookworm/non-free amd64 Packages
release v=12.4,o=Debian,a=stable,n=bookworm,l=Debian,c=non-free,b=amd64
origin deb.debian.org
900 https://deb.debian.org/debian bookworm/contrib amd64 Packages
release v=12.4,o=Debian,a=stable,n=bookworm,l=Debian,c=contrib,b=amd64
origin deb.debian.org
900 https://deb.debian.org/debian bookworm/main amd64 Packages
release v=12.4,o=Debian,a=stable,n=bookworm,l=Debian,c=main,b=amd64
origin deb.debian.org
Pinned packages:
$> apt policy linux-headers-amd64
linux-headers-amd64:
Installed: (none)
Candidate: 6.1.69-1
Version table:
6.1.69-1 900
900 https://deb.debian.org/debian-security bookworm-security/main amd64 Packages
6.1.67-1 900
900 https://deb.debian.org/debian bookworm-updates/main amd64 Packages
6.1.66-1 900
900 https://deb.debian.org/debian bookworm/main amd64 Packages
Also note that your second solution is also not what you want (bookworm's priority is still 500).