Did you ever run into a situation where Debian Stable was just a tad too stable for you? You needed a newer version of a software package or one that’s not scheduled for inclusion until the next future Debian Stable release? That’s where the Debian Backports repository comes in. The Debian Backports repository enables you to install newer software, planned for the next Debian Stable release, on your current Debian Stable system. This article explains how this works.
Background
Debian’s renowned stability makes it an ideal candidate for servers. Also for desktop systems, if you value a system that just always works, even if it means using older versions of software. When installing software on Debian with the apt
package manager, you do so from the main
, contrib
or free
online package repositories of the Debian Stable release. Debian Stable contains software packages, where the version does not change over its lifetime. You only get security fixes, not bug fixes or new features.
After using Debian Stable for a while, eventually you likely run into a situation where this stable software policy results in paper cuts. When you:
- Need a software feature, only present in a newer version of the software.
- Would like to install software not yet available for Debian Stable.
The Debian team recognized this use case and offers the Debian Backports online package repository. The Debian Backports repository contains newer versions of specific software packages, taken from the Debian Testing package repository. Think of Debian Testing as the sandbox for testing out new software packages, in preparation for the future Debian Stable release. These packages are rebuilt using the Debian Stable base. You can install the resulting packages from the Debian Backports repository on your Debian Stable system, without risking the creation of a so-called FrankenDebian.
Personally, I ran into this situation a few times. One time I needed some newer features in Ansible and therefore installed Ansible from the Debian Backports repository. Recently, I wanted to use pipx, only to realize that it probably won’t be available until the next Debian Stable release. This article explains how you install software from the Debian Backports package repository.
What do you need
If you want to follow along, in a hand-on manner, with the steps in this tutorial, you just need a Debian Stable system . We’ll do everything directly in the terminal, meaning that you can use either a Debian server of desktop system. I’ll be using Debian 11 “Bullseye” for this tutorial, running inside a VirtualBox virtual machine.
To find out the exact Debian Stable version of your system, run the command:
cat /etc/os-release
Make a mental note of the codename part, bullseye
in my case. We’ll need it later on.
Add the Debian Backports repository to your sources.list
Before we can install software from the Debian Backports repository, we first need to inform Debian’s package management system about the location of the repository. You do this by adding the following line to the file /etc/apt/sources.list
:
deb http://deb.debian.org/debian bullseye-backports main
If the current Debian Stable release is no longer bullseye
, then replace the bullseye
text with the codename of the current Debian Stable release. You can edit the sources.list
file directly from the terminal with the help of the versatile Nano text editor:
sudo nano /etc/apt/sources.list
Afterwards, it looks like this:
Once we added the Debian Backports repository to the sources.list
file, we need to download its package list, before we can install anything from it. This gives Debian’s package management system information about:
- Which software packages the Debian Backports repository holds, including the version number.
- The dependencies that each software package has on other packages.
Run the following command to download the package lists from all known package repositories:
sudo apt update
Install software from the Debian Backports repository
At this point, you performed all the necessary steps to prepare the installation of software, from the Debian Backports repository. Note that you do not need to uninstall a software package, when you plan on installing a newer version from Debian Backports.
Installing a software package from Debian Backports, resembles how you would install it from Debian Stable. You just need to add -t bullseye-backports
to the apt
command. This assumes that the current Debian Stable release is bullseye
. Adjust this according to the codename of your currently installed Debian Stable system.
As an example, we’ll take the pipx
software package. This relatively new Python related tool allows you to install Python application from PyPI, in an isolated environment. The isolated environment consists of basically a Python virtual environment. The main difference being, that you do not have to explicitly activate the Python virtual environment, before you can run the application. Very convenient and a perfect middle ground between installing the Python application in the global Python environment and installing the Python application in its own manually created Python virtual environment.
With bullseye
as the current Debian Stable, the package repositories do not yet offer pipx
. However, Debian Backports does offer it. The perfect example for this article. To install pipx
from the Debian Backports repository, run this command:
sudo apt install -t bullseye-backports pipx
How to find software in Debian Backports
If you made it this far through the tutorial, you know how to enable the Debian Backports repository on your Debian system and how to install software from it. But how do you know if a software package is available in Debian Backports? I prefer using the Debian website.
You can find an overview of all software packages installable from Debian Backports at this URL:
If you know the specific package name, you can alternatively use the website for searching through all packages in the Debian Backports repository. You can find it at URL:
Just make sure to select the Debian Backports repository from the drop-down box, bullseye-backports
on this screenshot:
What to do when software is not available in Debian Backports
The Debian Backports repository can be a lifesaver. Unfortunately, it does not offer new versions of all software packages from Debian Stable. What to do if Debian Backports does not offer the software package that you need?
Several options exist:
- Install the software application as a Flatpak, AppImage or snap.
- Try to find it at a third party package repository. For example, openSUSE’s OBS offers Debian packages as well.
- Build and install the software manually from source code.
My personal preference goes to installing applications as a Flatpak. I dedicated an entire tutorial towards it a little while back:
Wrap up
After working your way through this article, you know how to install software packages from the Debian Backports repository. The perfect solution when you:
- Would like a software feature, only present in a newer version of the software.
- Need to install software not yet available for Debian Stable.
Before you can install software packages from Debian Backports, you first register the repository with the Debian package management system. You achieve this by adding the following line to /etc/apt/sources.list
:
deb http://deb.debian.org/debian bullseye-backports main
Next, download the package lists from the Debian Backports repository:
sudo apt update
From this point forward, you can install software packages from Debian Backports, using the command:
sudo apt install -t bullseye-backports <package name>