in apt-pinning · debian · paquetes · squeeze

Being up to date in Debian while staying on the stable branch

Let us get straight to the point.

Basic concepts:

Debian keeps several repositories or branches of packages, each one with its own package versions.

The ones that interest us are:

  • oldstable

 

  • stable (currently: «squeeze»)
  • testing
  • unstable
  • experimental

There is another branch: backports. The «backports» packages are new package versions that have been ported to the stable branch.

A freshly installed Debian system has «stable» as its default repository. But we can install packages from other branches easily.

Comments

For years, I have had systems on unstable without problems.

What I do now is have a system with repositories from the «stable» and «backports» branches, and optionally, for those packages where I am interested in being up to date, I install from other branches.

Setting up a mixed system with apt-pinning

What apt-pinning allows us is to have different Debian branches.

You can set this up graphically with the Synaptic package manager, or by modifying these files, which, being so simple, is what we opt for.

File: /etc/apt/sources.list

#########################STABLE########################################
deb http://ftp.es.debian.org/debian/ squeeze non-free contrib main
deb http://security.debian.org/ squeeze/updates non-free contrib main
deb http://ftp.es.debian.org/debian/ squeeze-proposed-updates non-free contrib main
### Squeeze backports #####
deb http://backports.debian.org/debian-backports squeeze-backports main contrib non-free
#########################TESTING#########################################
#deb http://ftp.es.debian.org/debian/ testing main contrib non-free 
#########################UNSTABLE########################################
#deb http://ftp.es.debian.org/debian/ unstable main contrib non-free
#########################EXPERIMENTAL####################################
#deb http://http.us.debian.org/debian/ experimental main contrib non-free

Note: the attentive reader will see the hash character # in front of the testing, unstable and experimental branches; this is because right now I am not using them. Anyone who needs them only has to enable them, by removing the hash #.

File: /etc/apt/preferences

Package: *
Pin: release a=squeeze-backports
Pin-Priority: 900

Package: *
Pin: release a=squeeze
Pin-Priority: 800

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

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

Package: *
Pin: release a=experimental
Pin-Priority: 500

With these priorities, when we update the system the packages from stable (squeeze) are given priority, so the other branches are «not taken into account» unless we explicitly install packages from other branches.

For example, to install a browser such as «midori», we normally do:

apt-get install midori

Now we can do:

apt-get install midori -t testing

apt-get install midori -t unstable

The first command installs midori from the testing branch, the second installs midori from the unstable branch.

Final Comments

It is also useful to know that we can comment out (disable) these repositories by putting the hash character # in front of the repository in /etc/apt/sources.list, and enable it whenever we want by removing the hash.

Well, that settles it: it is proven that this odd concept called «apt-pinning» is nothing more than something as simple as having several repositories available and installing packages from whichever branch you want.

Something that those obsessed with being up to date will find useful and simple

Sources: http://www.esdebian.org/wiki/sistemas-mixtos