Mind Dump, Tech And Life Blog
written by Ivan Alenko
published under license CC4-BY
posted in category Systems Software / Distros & System
posted at 07. Mar '24

Howto Lower The Priority of Testing Repo in Debian

The goal is to be able to install a package from testing with apt-get -t testing install podman, but the base system is stable. The solution is to lower the priority of testing repository so the system won’t upgrade to testing. If they are equal (100), testing wins (or maybe the last repository in apt sources?).

Put this file into /etc/apt/preferences.d/:

$ cat /etc/apt/preferences.d/99lowertesting
Package: *
Pin: release o=Debian,a=testing,l=Debian,c=main,b=amd64
Pin-Priority: 50

Then apt-cache policy will show pin priority as 50.

root@starz:~# apt-cache policy
Package files:
 100 /var/lib/dpkg/status
     release a=now
  50 http://ftp.cz.debian.org/debian testing/main amd64 Packages
     release o=Debian,a=testing,n=trixie,l=Debian,c=main,b=amd64
     origin ftp.cz.debian.org
 100 http://ftp.debian.org/debian bookworm-backports/main amd64 Packages
     release o=Debian Backports,a=stable-backports,n=bookworm-backports,l=Debian Backports,c=main,b=amd64
     origin ftp.debian.org
 500 http://ftp.cz.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 ftp.cz.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 http://ftp.cz.debian.org/debian bookworm/main amd64 Packages
     release v=12.5,o=Debian,a=stable,n=bookworm,l=Debian,c=main,b=amd64
     origin ftp.cz.debian.org
Pinned packages:

And that’s all.

Add Comment