Skip to main content.

Mon, 27 Aug 2007

Backporting with apt-src

Let's say you run Ubuntu but want the freshest package of something from Debian Unstable. Or you run Debian Stable and you want some crazy multimedia package that only Ubuntu packages.

For many packages, it is pretty easy to "backport" them between distributions or between releases. Let's say you run Ubuntu or Debian stable and you want the latest version of my alpine package. Here's what you do:

Step 1: Make sure you have an appropriate deb-src line

Backporting is the process of taking source packages and compiling them on your Debian(-like) system. The easiest way to find Debian "source packages" is the same way you find Debian "binary packages": apt-get and its configuration.

Make sure you have this line in /etc/apt/sources.list:

deb-src http://ftp.debian.org/debian/ unstable main

Step 2: apt-get update

Step 3: install "apt-src"

Just do 'sudo aptitude install apt-src'. apt-src is a helper program that makes compiling source packages easy. It's not necessary, but it prevents you from having to type too many commands.

Step 4: apt-src -bi install $package

If you wanted to install 'alpine', just do:

apt-src -bi install alpine

The "b" stands for "build", the "i" stands for "install the resulting package", and the word "install" means "download the source for alpine as found in a Debian source line from sources.list". apt-src will "install" the source into the current directory, make sure you have all the required packages to build the package (a process called "satisfying the build dependencies"), build it, and install the resulting .debs.

Step 5: Run the new program

You should be done now!

[] permanent link and comments

Comment form

  • The following HTML is supported: <a href>, <em>, <i>, <b>, <blockquote>, <br/>, <p>, <abbr>, <acronym>, <big>, <cite>, <code>, <dfn>, <kbd>, <pre>, <small> <strong>, <sub>, <sup>, <tt>, <var>
  • I do not display your email address. It is for my personal use only.

Name: 
Your email address: 
Your website: 
 
Comment: