inaabi / Guides / Install one package from Debian backports
Install one package from Debian backports
Enable bookworm-backports or trixie-backports and install a single package without switching the rest of the system.
Tested on Debian 12.15 and Debian 13.8, 2026-12-04.
Backports is newer package versions rebuilt for the Debian release you already run. The archive publishes them at priority 100, so a normal upgrade does not take them. The instructions are on backports.debian.org.
The test ran as root in a throwaway container on 2026-12-04. The package that day was tmux. Versions move. Read apt-cache policy on your machine before you install. On a machine where you are not root, run the same commands with sudo.
See that backports are not the candidate
On Debian 12.15, before any pin file existed, apt-cache policy tmux showed:
tmux:
Installed: (none)
Candidate: 3.3a-3
Version table:
3.5a-2~bpo12+1 100
100 https://deb.debian.org/debian bookworm-backports/main amd64 Packages
3.3a-3 500
500 https://deb.debian.org/debian bookworm/main amd64 Packages
The candidate was tmux 3.3a-3 from bookworm. The newer backport sat at priority 100. Nothing under /etc/apt/preferences.d set that 100. The archive publishes it.
On Debian 13.8 the same command showed candidate tmux 3.5a-3 from trixie at priority 500, and 3.7c-1~bpo13+1 from trixie-backports at priority 100.
Add the backports suite
Use Debian's own keyring. This is not a third-party archive. On these images Signed-By pointing at debian-archive-keyring.gpg worked. Install ca-certificates first if you use https:// and that package is missing. See APT sources on Debian 12 and 13.
Debian 12:
cat > /etc/apt/sources.list.d/debian-backports.sources << 'EOF'
Types: deb
URIs: https://deb.debian.org/debian
Suites: bookworm-backports
Components: main
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
EOF
apt-get update
apt-get update exited 0.
Debian 13 uses the same file with Suites: trixie-backports. That update also exited 0. Do not point a bookworm machine at trixie-backports, and do not point a trixie machine at bookworm-backports.
bookworm-backports-sloppy was not enabled. Leave it out unless a package exists only there, and read the backports instructions on sloppy first.
Install one package
Name the suite. Dependencies stay on the release you already run when that release's version is enough.
apt-get install -y --no-install-recommends tmux/bookworm-backports
On Debian 12.15 the install exited 0. apt selected tmux 3.5a-2~bpo12+1 from bookworm-backports, libevent-core-2.1-7 from bookworm-security, and libjemalloc2 from bookworm.
On Debian 13.8 the command was tmux/trixie-backports. The install exited 0. tmux was 3.7c-1~bpo13+1. libevent-core-2.1-7t64 and libjemalloc2 came from trixie, not from backports.
--no-install-recommends kept the install to those packages. The run without that flag was not done.
Check the installed version
dpkg-query -W tmux
apt-cache policy tmux
Debian 12 printed tmux 3.5a-2~bpo12+1. The candidate stayed that version, at priority 100. Bookworm's older 3.3a-3 remained in the table at priority 500. Apt did not switch the candidate back, because that would be a downgrade, and priority 500 does not downgrade.
Debian 13 printed tmux 3.7c-1~bpo13+1. A backport's version contains ~bpo. Bookworm uses ~bpo12. Trixie uses ~bpo13.
dpkg-query -W | grep '~bpo'
Remove the package and the suite
apt-get remove -y tmux
rm /etc/apt/sources.list.d/debian-backports.sources
apt-get update
apt-cache policy tmux
Tested on both releases. apt-cache policy showed Installed: (none). Debian 12's only candidate was 3.3a-3 at priority 500. Debian 13's was 3.5a-3 at priority 500.
Apt said the libevent and libjemalloc packages were no longer required and printed apt autoremove. That command was not run. Run it if you want those libraries removed too.
A later apt-get upgrade does not start installing every backport. Those versions stay at priority 100 until you name them. To prefer one package, or to refuse it, see Pin a package on Debian.
Questions
Will apt upgrade pull every backport?
No. A package that is not installed stays at priority 100, below the release you are on. The test showed tmux's candidate was the stable version until the install command named the backports suite.
Can I undo a backport by deleting the source file only?
Deleting the file stops new installs from backports. It does not remove a package you already installed. apt-get remove does that. Restoring the bookworm or trixie candidate was tested after both the remove and the file delete.