Upgrading to Debian Testing

Recently, I took the plunge into moving from Debian Stable (aka Jessie) to Debian Testing (aka Stretch). This seems to be the most common move for people who are comfortable using Debian. I've been on Debian now for about two years, starting with CrunchBang/#! and then moving to Stable when Jessie was released. I've grown comfortable with the Debian ecosystem, but some of the dated software was getting to me. Anyways, if this sounds like you, I've written a bit of light documentation for updating from Stable to Testing.

Pre-Tutorial Notes

Debian Testing does have some security and stability implications. For example, software needs to be bug free for seven days in Debian Experimental (Sid) in order to be placed in Testing. This could mean, for example that if a major bug/security issue is discovered AFTER software moves to Testing, it may take a week or more to fix that bug. While many people do use it as such, Testing is not advised for use on production machines. You do this at your own risk.

Tutorial

First, Debian documentation recommends that you start with a clean install before upgrading. This is excellent advice and something that I recommend as well. Alernatively, you could just use the Testing image of the installer.

On your fresh Debian Stable machine edit /etc/apt/sources.list with your favorite editor (mine is vim):

sudo vim /etc/apt/sources.list

Here is what your file should look like before you start:

deb http://httpredir.debian.org/debian jessie main
deb-src http://httpredir.debian.org/debian jessie main

deb http://httpredir.debian.org/debian jessie-updates main
deb-src http://httpredir.debian.org/debian jessie-updates main

deb http://security.debian.org/ jessie/updates main
deb-src http://security.debian.org/ jessie/updates main

Obviously, httppredir.debian.org will be based on your selected repo address during installation.

If you notice, each of the lines follows this format:

deb http://site.example.com/debian distribution component
deb-src http://site.example.com/debian distribution component

The part that we are interested in is the "distribution" section. In our original file, it is the part that says "jessie". We'll want to change that part to say "stretch". Alternatively, you could also use the word "testing" but this will continue to track testing even after stretch becomes the new stable release. Its generally a good idea to avoid testing for a short while after a stable release, so I generally recommend sticking to code name/alias releases like wheezy, jessie, and stretch. Your final file should look like this:

deb http://httpredir.debian.org/debian stretch main
deb-src http://httpredir.debian.org/debian stretch main

deb http://httpredir.debian.org/debian stretch-updates main
deb-src http://httpredir.debian.org/debian stretch-updates main

deb http://security.debian.org/ stretch/updates main
deb-src http://security.debian.org/ stretch/updates main

Save your file (i.e. w/ ":wq" in vim).

Update your apt repo.

sudo apt update

You will get a huge list of upgradable packages. That's a good thing. Run the upgrade.

sudo apt upgrade

You'll likely be asked about whether you want to restart services automatically or not when they are upgraded. Since this isn't a production machine (it's not a production machine.... right?), its probably safe to do that.

Then go ahead and move on with your install like normal. You are now running Debian Testing!

Post-Tutorial Notes

Occasionally, when attempting to install a package, Debian will complain that it is not available. The best thing to do in this case is to update your apt repo and upgrade any upgradeable packages and try again.

sudo apt update
sudo apt upgrade
sudo apt install <your_package>

Enjoy the updated packages! Just watch out for bugs!