November 20, 2007

Apt Pinning

Afer using Debian Lenny (testing) for a while and being pretty conservative with it in terms of package upgrading, I decided it was time my Lenny installation saw some updated packages, specifically Clearlooks and Epiphany (v2.14.3). In order to do this more effectively without completely upgrading to Debian Sid (unstable) I did apt pinning.

Apt pinning will allow me to install packages from the unstable branch, which are more up to date, while keeping my testing installation. In order to achive this, You have to create two new config files in your /etc/apt directory. First, make a file called /etc/apt/apt.conf and place the following line:

APT::Default-Release "testing";


Now create a file called /etc/apt/preferences and in it place the following:

Package: *
Pin: release o=Debian,a=testing
Pin-Priority: 900

Package: *
Pin: release o=Debian,a=unstable
Pin-Priority: 300

Package: *
Pin: release o=Debian
Pin-Priority: -1


The preferences file changes the repositories' priority so that testing's will be higher than unstable on package upgrades and installations. Now you can add Debian's unstable repository to your sources.list

# Debian Unstable
deb http://ftp.us.debian.org/debian/ unstable main contrib non-free
deb-src http://ftp.us.debian.org/debian/ unstable main contrib non-free


In order to upgrade a package to the version in unstable, you simply use the following:

sudo aptitude install package/unstable


That is all. Now I have a Debian testing system and I'm able to install unstable packages at will.

No comments: