Debian 12: Switching from stable to testing

Michael

Administrator
Staff member
Feb 11, 2022
87
4
8
What is Debian Testing?

Debian Stable usually offers older software versions. Switching to the Testing branch gives you recent software with the classic Debian experience.

Debian offers you 3 variants of Debian:

  • Debian stable (what you get by default from their homepage).
  • Debian testing (has newer packages and breaks less often than Debian unstable, usually it is rare).
  • Debian unstable (has the most recent packages and is pretty stable, but it will break far more often than testing).

Many Debian users prefer the testing variant over the stable version. Despite the name testing, it is pretty stable.

Switch from Debian stable to Debian testing​

Warning: You can not easily downgrade from Debian testing to Debian stable, as installer scripts and installation tools are only designed to replace the older version with the new one. Therefor I would recommend using TimeShift to create a backup before applying the shown steps on your main machine.

First, update the existing packages using the given command:

Code:
sudo apt update && sudo apt upgrade -y

Next, make a copy of original sources.list file:

Code:
sudo cp /etc/apt/sources.list sources.list.backup

Step 1: Edit sources.list file​

There are two ways of editing sources.list file. Either you can manually alter the current release name with testing or you can use the sed command to get your job done.

And I’m going with a 2nd one to make the whole process easier. You just have to use the given command, and it will replace bullseye with testing for you:

Code:
sudo sed -i 's/bookworm/testing/g' /etc/apt/sources.list

Now, open your terminal and use the given command to open sources.list files:

Code:
sudo nano /etc/apt/sources.list

And comment out the lines having security.debian.org and anything that ends with -updates as shown below:

comment-out-security-sources.gif

If you are using nano as I do, you can press Alt + / to jump to the end of the line. And then you have to add the following line:

Code:
deb http://security.debian.org testing-security main

Screenshot from 2024-02-13 16-11-29.png

And save the changes and exit from the nano text editor.


Step 2: Update the Repository and install new packages​


Now, update the repository index, and it will show you a massive update pending:

Code:
sudo apt update

Now, you can use the given command, and it will get you the most recent packages:

Code:
sudo apt upgrade

Sit back and relax as it is going to take a while.

Once done, it will present you with the list of changes made as you switched from Debian stable to testing.

Now you may have additional pop-up windows; it will show you the message that some of the libraries installed on your system needs to restart. Press the TAB key, and it will select the OK option, and then press Enter


Next, it may ask you whether you want to restart services during the package upgrade. Here you have a choice. As I’m doing this for desktop usage only, I will go with YES.


Once done, you can reboot your system and then use the following command to have full effect from the changes you’ve just made:

Code:
sudo apt full-upgrade

Now, reboot your system, and you’ll have the most recent packages.
 
Last edited: