How to Install Backports & Experimental Repository on Debian 11

Debian is known amongst the Linux community for its gold standard in being stable, and a common drawback can be that the packages, especially after the new Debian release ages are that they are often years behind what is currently available as they only receive security and bug updates to keep packages stable.

Now for most environments, this is totally acceptable. Still, it can be very frustrating for users needing certain packages to be upgraded to utilize the features or fix annoying non-critical or security-related bugs. However, the great thing about Linux and using repositories is that you can use what is known as backports or experimental repositories, which are packages taken from the next Debian release, which is nearly always the testing repository and adjusted recompiled for usage on Debian stable.

The following tutorial will teach you how to use backports to install or upgrade an individual package or blindly upgrade your entire system. As a bonus, the tutorial has included the experimental option for those who love to live on the edge.

Advertisement

Prerequisites

  • Recommended OS: Debian 11 Bullseye
  • User account: A user account with sudo privilages or root access (su command).

Updating Operating System

Update your Debian 11 operating system to make sure all existing packages are up to date:

sudo apt update && sudo apt upgrade

Root or Sudo Access

By default, when you create your account at startup with Debian compared to other distributions, it does not automatically receive sudoers status. You must either have access to the root password to use the su command or visit our tutorial on How to Add a User to Sudoers on Debian.

Add Backports Repository to Debian 11

The first step to installing packages from the backports repository is first to add them to the sources.list file. To do this, open up your Debian terminal and execute the following command:

sudo nano /etc/apt/sources.list

Go to the end of the file is preferred and add the following lines:

deb http://deb.debian.org/debian bullseye-backports main contrib non-free
deb-src http://deb.debian.org/debian bullseye-backports main contrib non-free

Example:

How to Install Backports & Experimental Repository in Debian 11

Save the configuration file (CTRL+O), then exit with (CTRL+X).

To update the repository list with the new changes, run the apt update command:

sudo apt update

This will have refreshed the repository cache with the backports packages available to utilize and install packages from if desired.

Advertisement

How to Install or Upgrade with Backports

Using backports on Debian is very straightforward; you can either install a direct package from backports (recommended 99.99% of the time) or blindly update your entire system to use the latest backport packages (not recommended).

Install or Upgrade Packages from Debian Backports

To install specific packages from the Debian backports repository, the syntax will be similar to installing a normal package except for adding -t flag and specifying the name bullseye-backports.

Example:

sudo apt install "package-name" -t bullseye-backports

Live Example installing Cockpit:

sudo apt install cockpit -t bullseye-backports

The normal Cockpit package from Debian 11 default repository is version build 239; with the backports, we now have a much more updated version with the Cockpit package at version build 251.

Advertisement

Upgrade All Packages From Backports

The second option isn’t recommended as it is more ideal to know which backports you are installing. To upgrade all packages, run the following command in your terminal:

sudo apt -t bullseye-backports update && sudo apt -t bullseye-backports upgrade

Example:

How to Install Backports & Experimental Repository in Debian 11

To proceed with the updates, type Y, then press enter key if you would like to install these backport packages.

Optional – Add Debian Experimental Repository

For those who love to live on the edge of their seat, you can install the Experimental repository, which can get you the most bleeding-edge updates from Debian; however, this should not be used unless you are on a throw-away test VM or a developer/sysadmin with a purpose needing a package from this repository or an advanced power user that can handle dealing with any issues that go wrong since the changes of incompatibilities is a lot higher.

Re-open your sources.list configuration file, and add the following to the bottom underneath what you just previously added:

deb http://deb.debian.org/debian experimental main contrib non-free
deb-src http://deb.debian.org/debian experimental main contrib non-free

Example:

How to Install Backports & Experimental Repository in Debian 11

Save the configuration file (CTRL+O), then exit with (CTRL+X).

To update the repository list with the new changes, run the apt update command:

sudo apt update

This will have refreshed the repository cache with the experimental packages available to utilize and install packages from if desired.

As above, with the tutorial focusing on using backport commands to install packages, all you need to do is replace backports with experimental ones.

Example:

From:

sudo apt install "package-name" -t bullseye-backports

To:

sudo apt install "package-name" -t experimental

Remember, be cautious using anything from an experimental repository, especially on live production servers or live environments like running WordPress CMS or similar.

Upgrade All Packages From Experimental

As the same principle explained for the backports, you can upgrade all packages at once. This is not recommended at all as it basically makes you upgrade to the unstable experimental Debian system. However, for those not shy:

sudo apt -t experimental update && sudo apt -t experimental upgrade

Example output:

How to Install Backports & Experimental Repository in Debian 11

To proceed with the updates, type Y, then press enter key if you would like to install these backport packages.

Use Latest Kernel from Debian Experimental

For users that love to live on the edge, as the tutorial has explained above, currently, at the time of writing, Debian Bullseye is utilizing the Linux kernel 5.10.x, currently in the experimental repository Linux Kernel 5.13.x is available. For those that are interested, you can upgrade as follows:

sudo apt install linux-image-amd64 -t experimental

Example output:

How to Install Backports & Experimental Repository in Debian 11

As with any kernel upgrade, you will need to reboot your Linux system for the new kernel to be live:

sudo reboot now

Once you have finished rebooting your operating system, verify your new Linux kernel as follows:

cat /proc/version

Example output:

Linux version 5.13.0-trunk-amd64 (debian-kernel@lists.debian.org) (gcc-10 (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.37) #1 SMP Debian 5.13.12-1~exp1 (2021-08-20)

As you can see, you are now using Linux Kernel 5.13.0 and build version 5.13.12.1 in particular. This kernel is likely unstable and should only be used if you have the newest hardware requiring a more updated kernel for the hardware support. Make sure to keep checking back for kernel updates, as this will change quite regularly.

Comments and Conclusion

In the tutorial, you have learned how to add and install or upgrade packages from the Debian backports repository with extra knowledge of using the bleeding-edge Experimental repository. Overall, these repositories can be convenient for getting updated and the latest packages with many improvements over what exists in the default Debian 11 repository, especially in time as Debian stables can last years without much change. However, with the cool things, you must be careful; you can easily break your system and, better yet, introduce security issues if you are not cautious and, more importantly, proactive in using the packages for now and future use.

Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
adplus-dvertising
0
Would love your thoughts, please comment.x
()
x