How to Switch from Debian Stable to Testing: A Step-by-Step Guide

Keep your Debian system fresh and current by switching from Stable to Testing with our easy-to-follow step-by-step instructions.

Debian stands as one of the most respected Linux distributions in the world. It is often favored for its rock-solid reliability and extensive software repositories.

However, for those who crave the latest software innovations, the somewhat conservative nature of Debian Stable can be a double-edged sword. In other words, the price paid for this stability is time-proven but slightly outdated software versions.

But there is a solution! This article will explore the intricacies of switching from Debian Stable to Testing, allowing you to strike a balance between stability and freshness tailored to your needs.

But, before we get started, let’s go through what Debian Testing is and what advantages you get by switching to it.

What’s Debian Testing?

Debian Testing is one of the three main branches of the Debian operating system, positioned as a middle ground between Debianโ€™s Stable and Unstable (SID) versions.

In other words, unlike Debian Stable, which is known for its rock-solid stability and infrequent major updates, and Debian Unstable, which is a constantly evolving development branch, Debian Testing falls somewhere in between.

It is often chosen by Linux enthusiasts and experienced users who want a compromise between the rock-solid stability of Debian Stable and the cutting-edge software in Debian Unstable.

Benefits of Switching to Debian Testing

Here are the three main benefits you will get after converting your currently stable Debian system to the testing branch:

  1. More up-to-date software: Debian Testing receives regular updates and new package versions from the Debian Unstable branch. This means users of Debian Testing can access more up-to-date software compared to Debian Stable.
  2. Stability: While Debian Testing is not as rigorously tested and stable as Debian Stable, it is still relatively stable compared to many other Linux distributions. So, it is a good compromise between stability and access to newer software.
  3. Compatibility: Debian Testing aims to maintain a good balance between compatibility and freshness. The packages in Testing are generally well-integrated and tested to work together, reducing the likelihood of conflicts.

However, it is essential to note that while Debian Testing provides good stability, it may occasionally have issues or bugs, mainly when major transitions or updates occur. So, users should be prepared for troubleshooting and system maintenance when running Debian Testing.

Switch from Debian Stable to Testing

Switching from Debian Stable to Debian Testing involves updating your systemโ€™s package sources and performing a system upgrade.

For this guide, we will use Debian 12. Hereโ€™s our system before upgrading to the Testing branch.

Debian 12 Stable
Debian 12 Stable

Step 1: Backup Your Data

Before making any changes, ensure you have a backup of your valuable data and configurations. This is a precautionary step in case anything goes wrong during the upgrade.

This is important because the move to the Testing branch involves significant changes to your system, so there’s always a small risk of issues during the transition.

Step 2: Update Debian Stable

Ensure your Debian Stable system is fully up-to-date by running the following commands in the terminal:

sudo apt update
sudo apt upgrade
Ensure your current Debian Stable system is fully updated.
Ensure your current Debian Stable system is fully updated.

If there are any pending updates, apply them and reboot if necessary before moving on.

Step 3: Edit the sources.list File

First, following best practices, it is a good idea to take a backup of the “/etc/apt/sources.list” file in case we need to use it later for some reason.

sudo cp /etc/apt/sources.list /etc/apt/sources.list.bckpCode language: PHP (php)

Next, modify your “/etc/apt/sources.list” file to point to Debian Testing repositories.

To do so, open the file with a terminal-based text editor, for example Nano, and replace the strings found in lines starting with โ€œdebโ€ or โ€œdeb-src,โ€ referencing the distributionโ€™s codename with the word โ€œtesting.โ€

Since the version of Debian we are using in this guide is the latest currently stable one, namely Debian 12 Bookworm, we will replace the string “bookworm” with “testing“. For example, “bookworm-security” becomes “testing-security,” “bookworm-updates” becomes “testing-updates,” etc.

Below is the default “sources.list” file before the modification, and we have marked the strings that need editing.

sudo nano /etc/apt/sources.listCode language: PHP (php)
The default "sources.list" file on Debian 12 before the modification.
The default “sources.list” file on Debian 12 before the modification.

Make the necessary changes, then save the file and exit. Hereโ€™s what the final version should look like.

Debian with repositories changed to the Testing branch.
Debian with repositories changed to the Testing branch.

In addition, if you have added any other stable-specific apt sources to your system, such as *-backports or *-updates, remove, disable, or comment them out.

Step 4: Perform Upgrade from Debian Stable to Debian Testing

Everything is in place to switch from Debian Stable to Testing. To begin, run the command below to update the package list so your system knows the new repositories and their packages.

sudo apt update
Refreshing the package base.
Refreshing the package base.

Then, run the upgrade, which will update the currently installed packages of your Debian stable release with those of the test one.

sudo apt upgrade

As a relatively large amount of updates will need to be downloaded, be patient and wait for the process to complete.

After that, you will be provided with a list of the changes that will be made to your system. Press โ€œqโ€ to exit and continue upgrading to the Debianโ€™s Testing branch.

List of changes to be made.
List of changes to be made.

Your system upgrade will start, and at the beginning, you will be asked if you want the running services to be automatically restarted during the process. Select โ€œYes.โ€

Choose the automatic service restart during the upgrade.
Choose the automatic service restart during the upgrade.

Depending on your hardware, switching from Debian Stable to Testing will take between a few and 15 minutes. At its end, the terminal will display similar to what is shown below.

The upgrade process succeeded.
The upgrade process succeeded.

Finally, complete the upgrade process by running:

sudo apt full-upgrade
Completing the upgrade process.
Completing the upgrade process.

And that’s it. Reboot the system and enjoy your new Debian Testing system containing recent software versions.

We have successfully upgraded from Debian Stable to the Testing branch.
We have successfully upgraded from Debian Stable to the Testing branch.

As a final recommended step, you can remove unnecessary packages from your system by running the following:

sudo apt autoremove --purge
Remove unnecessary software.
Remove unnecessary software.

Conclusion

Throughout this step-by-step guide, we’ve navigated the process of migrating from the steadfast Debian Stable to the more dynamic Debian Testing.

So, for those seeking a harmonious blend of stability and fresh software, the transition should now provide you with more up-to-date software while maintaining a reasonable level of stability.

However, bet on the Testing branch only if it is a desktop system. We highly recommend sticking to Debianโ€™s stable release for servers, which guarantees you the long-term reliability and security you need.

For more information, please refer to the official documentation. Thanks for your time! If you have any questions or feedback, feel free to comment.

Bobby Borisov

Bobby Borisov

Bobby, an editor-in-chief at Linuxiac, is a Linux professional with over 20 years of experience. With a strong focus on Linux and open-source software, he has worked as a Senior Linux System Administrator, Software Developer, and DevOps Engineer for small and large multinational companies.

Think You're an Ubuntu Expert? Let's Find Out!

Put your knowledge to the test in our lightning-fast Ubuntu quiz!
Ten questions to challenge yourself to see if you're a Linux legend or just a penguin in the making.

1 / 10

Ubuntu is an ancient African word that means:

2 / 10

Who is the Ubuntu's founder?

3 / 10

What year was the first official Ubuntu release?

4 / 10

What does the Ubuntu logo symbolize?

5 / 10

What package format does Ubuntu use for installing software?

6 / 10

When are Ubuntu's LTS versions released?

7 / 10

What is Unity?

8 / 10

What are Ubuntu versions named after?

9 / 10

What's Ubuntu Core?

10 / 10

Which Ubuntu version is Snap introduced?

The average score is 68%