install latest version of packages in debian

Install Newer Version of Packages in Debian using Backports

Debian is one of the most used Linux distribution out there, other popular distributions like Ubuntu, MX Linux etc are also based on Debian. One of the strong points of Debian is its steadiness. Stable version of Debian gets released a year after the previous one.

Unfortunately, with stable Debian releases, the packages that you have access to, while being stable, are often old and outdated. This is where backports come in.

What are backports?

Backport packages are taken from the next stable release of Debian. Then these packages get ‘ported’ (made compatible) for them to work on the current Debian Stable release.

Here in this tutorial, I will show you how you can install newer, updated version of packages in your Debian system via using Backports.

First, we will need to add a repository to our sources.list file. To do this, open a terminal and type:

sudo nano /etc/apt/sources.list

This will open the text file in nano editor. If the output says command not found, you can install nano via sudo apt install nano . Other text editors such as vim will do the work as well.

Once the file is open, add a new line and paste:

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

Now save the file (Ctrl+o) and exit nano (Ctrl+x).

Again in the terminal type:

sudo apt update

That’s it, you can now install backports version of any package on your Debian installation.

Just remember to use this command when you wan to install backport verrsion of a package:

sudo apt install -t buster-backports package_name

Note: Change package_name with the package that you are trying to install & buster in the buster-basckports will be replaced with the version of Debian you are running (i.e bullseye-backports if running Debian 11 Bullseye.).

For example to install the latest version of minetest in Debian 10 (Buster), you will type:

sudo apt install -t buster-backports minetest

If I normally install minetest without the -t buster-backports option, version 4 is getting installed.

installing package without backports debian

But with backports, I am able to fetch the more recent version of Minetest.

installing package with backports debian

Here are some commonly asked questions about Backports.

q1. Do backports provide the absolute latest release of a particular package?

a. No, backports of packages are simply taken form the current testing repos of Debian, i.e from the next release of Debian. Most of the times they will be of higher version than the ones in the Stable repos.

q2. Can I update backport packages with the normal apt update command?

a. Yes, once you have added the backports repository and have installed a packed via apt install -t *release-backports pkg_name, they will get updated with apt update command

q3. Can backports break my system (or some functionality) as they are packages meant for the next release of Debian.

a. While it is true that the packages are from the Next (i.e. current testing) release of Debian. They will probably not cause any issues as they get ‘ported’ for the current Debian version. However, backport Kernels for example, can sometimes cause issues.

q4. How to switch back to the stable version a package?

a. Just uninstall the package and install again via the normal command. The repository can also be removed (or commented) from the sources.list file.

Related Post: How to Update Kernel in Debian.

This concludes my post on Debian Backports. If it helped you, feel free to share the post with your friends. And as always, if you have any suggestions, feedback or comments regrading this post, feel free to leave a comment down below.

Leave a Reply

Your email address will not be published.