Enable backports in Debian 11
Sometimes the packages in Debian stable are way too old. In that case, you can use the backported repository to install packages in newer versions. It is not recommended to install every single package from the backported repo to keep your distro stable in the long term.
Instead only pick packages you need. Use the -t option with apt to force installation from the backported repo.
Enable backports in Debian
Open /etc/apt/sources.list
in your favorite editor.
$ sudo vi /etc/apt/sources.list
Add a line containing the following:
deb http://deb.debian.org/debian bullseye-backports main
Update apt configuration
$ sudo apt update
Check apt pritority configuration and make sure the backports repo has lower priority than the other repositories.
$ apt-cache policy
Package files:
100 /var/lib/dpkg/status
release a=now
500 https://nginx.org/packages/mainline/debian bullseye/nginx amd64 Packages
release v=11.0,o=nginx,a=stable,n=bullseye,l=nginx,c=nginx,b=amd64
origin nginx.org
100 http://deb.debian.org/debian bullseye-backports/main amd64 Packages
release o=Debian Backports,a=bullseye-backports,n=bullseye-backports,l=Debian Backports,c=main,b=amd64
origin deb.debian.org
500 http://security.debian.org/debian-security bullseye-security/main amd64 Packages
release v=11,o=Debian,a=stable-security,n=bullseye-security,l=Debian-Security,c=main,b=amd64
origin security.debian.org
500 http://deb.debian.org/debian bullseye/main amd64 Packages
release v=11.0,o=Debian,a=stable,n=bullseye,l=Debian,c=main,b=amd64
origin deb.debian.org
Pinned packages:
As you can see, the backported repo has lower number than the rest. It is a bit more complicated than that (you can check apt's man page), but for the purposes of this, let's just say that lower means lower priority.
No Comments