1. Home
  2. Linux

How to upgrade Debian distros [Guide]

Are you using Debian and want to upgrade it to other releases like Testing, Unstable, or even Experimental, but don’t know how? We can help! Follow along as we show you how to upgrade Debian distros!

upgrade Debian distros

How to upgrade Debian distros – upgrade to Testing

One of the best things about Debian is that users can choose what type of Debian release they like. Want newer packages? Upgrade Debian Stable to Debian Testing.

If you’d like to upgrade your release of Debian Stable to Debian Testing, start by opening up a terminal window. To open up a terminal window on the Debian desktop, press Ctrl + Alt + T or search for “Terminal” in the app menu.

Once the terminal window is open, use the sed command below to change over your software sources from “Stable” or “Buster” (Debian 10, the current stable release codename as of writing this) to the “Testing” codename.

sudo sed -i 's/stable/testing/g' /etc/apt/sources.list

If you have “buster” in your /etc/apt/sources.list instead of “stable,” execute the command below instead.

sudo sed -i 's/buster/testing/g' /etc/apt/sources.list

When you’ve finished changing over software sources in the /etc/apt/sources.list file, you’ll need to open up the file for editing purposes. Using the nano command below, open up the file.

sudo nano -w /etc/apt/sources.list 

Inside of Nano, locate deb http://deb.debian.org/debian/ testing-updates and delete that entire line of code. There’s no “testing” repo for security updates on Debian, but the sed command creates this line when replacing “stable” or “buster” with “testing.” Be sure also to delete deb-src http://deb.debian.org/debian/ testing-updates

After shutting off the security updates repo, save by pressing Ctrl + O and exit with Ctrl + X. Once outside of Nano, enter the commands below in succession to upgrade to Debian Testing.

sudo apt update 

sudo apt upgrade -y

sudo apt dist-upgrade -y

sudo reboot

How to upgrade Debian distros – upgrade to Unstable

If Debian Testing isn’t enough for you, you can always upgrade your Debian system to Debian Unstable. Unstable is where active Debian development occurs. Packages are updated frequently, and things are on the bleeding edge. 

Debian Unstable is an excellent distribution if you like Debian but find even Debian Testing’s packages a bit out of date. Upgrading to this version will allow you to always have the newest stuff on Debian. However, be warned, it’s not for beginners!

To upgrade from Debian Testing to Debian Unstable, open up a terminal window on the Debian desktop. To open up a terminal window, press Ctrl + Alt + T or search for “Terminal” in the app menu.

Once the terminal window is open, use the sed command to change your software sources list from “testing” to “unstable.” 

sudo sed -i 's/testing/unstable/g' /etc/apt/sources.list

Alternatively, If you’re coming straight from Debian Stable to Debian Unstable, you’ll need to do the following. First, change your software sources over by using sed.

sudo sed -i 's/stable/unstable/g' /etc/apt/sources.list

If you’re using “buster” in your /etc/apt/sources.list, rather than “stable,” execute:

sudo sed -i 's/buster/unstable/g' /etc/apt/sources.list

Next, if you plan to go straight from “Stable” to “Unstable,” open up /etc/apt/sources.list in Nano with the command below and delete both deb http://deb.debian.org/debian/ unstable-updates and deb-src http://deb.debian.org/debian/ unstable-updates. Save Nano with Ctrl + O, and close Nano with Ctrl +X when done editing.

Once all software channels are changed over to “Unstable,” upgrade your system to Debian Unstable by making use of the commands below.

sudo apt update 

sudo apt upgrade -y

sudo apt dist-upgrade -y

sudo reboot

How to upgrade Debian distros – Debian Experimental

Unlike Debian Testing and Debian Unstable, Debian Experimental isn’t a complete distribution. You can’t just convert your Debian Testing or Debian Unstable system into an entirely experimental release. However, you can install packages from the Experimental repo.

To gain access to the Debian Experimental repo, start by opening up a terminal window on the Debian Linux Desktop. Once the terminal window is open, open up your Debian sources list in the Nano text editor.

WARNING: Debian Experimental packages are in a pre-alpha state. They are incredibly unstable. Only use Debian Experimental if you are familiar with Debian and know how to fix it!

sudo nano -w /etc/apt/sources.list 

Inside the Nano text editor, add the following line of code. This line of code will enable you to access the Debian Experimental software repository. 

deb http://deb.debian.org/debian experimental main

After adding the line of code to your sources list in Debian, press the Ctrl + O keyboard combination to save the edits. Then, use the Ctrl + X button to exit the Nano editor.

Once you’ve closed the Nano text editor, type in sudo apt update in the terminal. This command will refresh Debian’s software sources and add the new “Experimental” packages to the package database.

sudo apt update

When everything is up to date, you’ll be able to install Debian Experimental packages by using the following command.

sudo apt -t experimental install packagename

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.