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%

10 Comments

  1. No chance! 🙂

    Debian stable is working for me — and it really does just work. And if I install mainly Flatpaks, I get app updates.

    That being said, the Testing stream is no doubt very good. But I must close my eyes to developments for a few years lest I become dissatisfied with Gnome 43 and get the urge to “upgrade”.

  2. Small amendment . . .
    “In addition, if you have added any other stable-specific apt sources to your system, such as *-updates, remove, disable, or comment them out.”
    And in the picture above you’re keeping testing-updates, which is kinda confusing. But do as in picture 🙂

    • Hi,

      The key point here is “stable-specific.” “testing-updates” does not fall into this category. 🙂

      Best,
      Bobby

  3. I enjoy how straight to the point your instructions are. Thank you!
    Of all the distros out there I cannot find one that does what I want the way I want it to. I must be too dang picky.
    I have print your instructions, I also print off the debian instructions for backporting a newer kernel as precaution.
    I’m going to install KDE with a 6.5 min. kernel to support Thunderbolt and use the newer software from testing so I can get what I want.
    Install Nvidia driver then I’m going to APT hold the kernel and nvidia.
    Call me wreakless but it’s not a server. It’s just a laptop I use a couple of hours a day and I like Debian. It’s just too dang old for creators. LOL
    Believe me this certainly is safer than building an Arch install. I’ve already crossed that bridge and burned it.

    • Hey Bob,

      Your comment truly brightens my day and makes all our hard work feel so rewarding. Thank you so much!
      As for Arch, well, I’ve been a bit partial towards it for the past 15 years, so I might just keep my opinions to myself on that one. 🙂 And when it comes to Debian Testing on desktop – I agree; it’s such a timeless classic that it’s hard to be beaten by any other distro.

      Best,
      Bobby

    • Got it done last night, very pleased with the result. Testing has a 6.5 Kernel, yay! Got a current version of KDE and all my addon apps.
      Sometimes being picky is just being persistent. Really happy I went with this solution.

  4. I tried this, but I didn’t work. It says I have conflicts. Maybe its because I originally had backports enabled in sources.list? I commented them out when I tried it – I followed the pictured sources.list [except I’m in Oregon so I use the osuosl mirror for everything except security]. Anyway, it just gives a conflict error and exits. Several actually, to many to list in a comment. Sigh. I was hoping for it to be easy. I want early access to KDE 6 when it drops into testing later this year.

Leave a Reply

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