So you want to stay mostly on stable but pick some bits from testing/unstable. I know I do; I’ve fallen off the wagon again (I’m quite proud I’ve managed to stay with a pure stable system so long—ever since sarge came out).

First, you need some testing/unstable sources. I’m going to assume you know how to do that. If not, then just forget about running a mixed system. It probably isn’t for you.

Second, you need to set your default distribution. You do that by putting the following line in /etc/apt/apt.conf:

APT::Default-Release "stable";

Technically, that should do it. Check by running the command apt-cache policy to see that the stable source(s) has higher priority than either of testing and unstable. If you’re like me and want more control you can put the following in your /etc/apt/preferences file:

Package: *
Pin: release a=stable
Pin-Priority: 900

Package: * Pin: release a=testing Pin-Priority: 600

Package: * Pin: release a=unstable Pin-Priority: 300 

This says that we should prefer candidate packages from stable over testing, and from testing over unstable. Check again by running apt-cache policy that the priorities are as you expect.

One important note here: I originally used sarge, etch & sid in place of stable, testing & unstable in my preferences file to avoid any nasty surprises when etch one day becomes the stable distribution. Unfortunately, this didn’t actually work and I did a bit of head-scratching before somebody pointed me at the apt-cache policy command.

More notes on Debian package management found here.

Leave a Reply