Debian backports and pinning

I’m running Debian Etch because I prefer the stable Debian package tree. This is all great but the software is a little outdated compared to other distributions like Ubuntu. That is where backports come in. Backports are recompiled packages from testing (mostly) and unstable (in a few cases only, e.g. security updates), so they will run without new libraries (wherever it is possible) on a stable Debian distribution. They recommend you to pick out single backports which fits your needs, and not to use all backports available here.

Using backports is simple

  1. Add this line to your /etc/apt/sources.list
  2. deb http://www.backports.org/debian etch-backports main contrib non-free
  3. Run
    apt-get update

    You might get a error message

    Reading package lists... Done
    W: GPG error: http://www.backports.org etch-backports Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY EA8E8B2116BA136C
    W: You may want to run apt-get update to correct these problems

    This message comes on Debian Etch because you haven’t imported the backports keyring. It’s easily fixed by running the command

    apt-get install debian-backports-keyring
  4. Since all backports are deactivated by default you got to tell the package manager to use the backports repository. To install a newer version of nmap
    apt-get -t etch-backports install nmap

It is important to remember that if you forget to tell apt-get that nmap is installed from backports and run another apt-get install nmap it will remove my backports package.

A simple solution to this is to use pinning
Edit /etc/apt/preferences, the file has to be created if you haven’t used pinning before

Package: nmap
Pin: release a=etch-backports
Pin-Priority: 999

Now the system “remembers” that nmap is installed from the backports repository and you don’t have to worry about it anymore, nice.

Source: http://www.backports.org/