You are here: Home / Debian GNU/Linux / System / Software / Setup the Debian Backports apt repository

Setup the Debian Backports apt repository

by Pierre-Yves Landuré last modified Oct 01, 2013 11:06

The Debian Backports repositories provide recent versions of fast release software. Maintained by the Debian community, they allow to install recent software without newer dependencies.

This howto is tested on :

  • Debian 6.0 Squeeze
  • Debian 7.0 Wheezy

Installation

Install the Linux Standard Base software :

command apt-get install lsb-release

Detect the distribution name :

DEBIAN_VERSION=$(command lsb_release -cs)

Detect the repository base URL :

BASE_URL="http://ftp.debian.org/debian"
if ! command wget --quiet --spider "${BASE_URL}/dists/${DEBIAN_VERSION}-backports"; then
BASE_URL="http://backports.debian.org/debian-backports"
fi

Add the software repository to the apt configuration :

command echo "# Debian Backports
deb ${BASE_URL} ${DEBIAN_VERSION}-backports main" \ > '/etc/apt/sources.list.d/debian-backports.list'

Update the list of available packages :

command apt-get update

Usage

You can now install software from Backports repository by using the -t option :

# command apt-get -t "squeeze-backports" install "package"

Thanks