How to Install Backports Debian Packages

If You are running Debian stable, because you prefer the stable Debian tree. It runs great, there is just one problem: the software is a little bit outdated compared to other distributions. 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. I recommend you to pick out single backports which fits your needs, and not to use all backports available here.

If you want to install Backport debian packages follow this simple procedure

First you need to add this line to your /etc/apt/sources.list file

deb http://www.backports.org/debian/ sarge-backports main contrib non-free

Add the following lines to your /etc/apt/preferences That will deactivate all packages from backports.org

Package: *
Pin: release a=sarge-backports
Pin-Priority: 200

If you want to activate a package (e.g. nagios2), add these lines to /etc/apt/preferences

Package: nagios2
Pin: release a=sarge-backports
Pin-Priority: 999

Then you need to update the source list using the following command

#apt-get update

Install the package using the following command

#apt-get install nagios2

as usual.

Another way is to skip the second entry in /etc/apt/preferences and to use

#apt-get -t sarge-backports install nagios2

which is easier when the package requires additional backports.

If you want to install any package you need to replace the nagios2 package name with the name of the package you want to install.

Sponsored Link

3 thoughts on “How to Install Backports Debian Packages

  1. i dont use that only one package method..

    i have just that backports tree and debian own stable trees in my sources and i’m very happy what i get from backports even its replaces some debian stables softwares.

    i dont really understand why people wants use that preferens file? too slow to install just one program (always need to edit that file) :O

  2. This page is considerably out of date.

    I ended up here as a result of a Google search for how to update Mercurial on Debian.
    FYI: There’s no preferences file as described
    I got errors when I ran apt-get update

    Turns out that backports is out of date and the most recent information I could find suggested that it could only supply up to version 1.3.

    I eventually found what I needed here:
    http://efreedom.com/Question/3-68518/Installing-Mercurial-on-Debian-Lenny

    In short add

    deb http://ftp.us.debian.org/debian sid main

    to

    /etc/apt/sources.list

    instead of what this article says.

    Then run

    apt-get update

    and then

    apt-get install mercurial

Leave a comment

Your email address will not be published. Required fields are marked *