Monday 18 July 2011

HOWTO: Run a mixed release Debian or Ubuntu Distribution

By inserting the following statements into your APT preferences file you can tell APT to prioritize the testing-repository and only if there are no suitable packages in testing to dip into the unstable-repository for the missing dependencies in testing.

/etc/apt/preferences

Package: *
Pin: release testing
Pin-Priority: 900

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

To enable this prioritization to work you must download both testing and unstable package lists. You do this by adding both repositories in your sources.list -file.

/etc/apt/source.list
deb ftp://ftp.fi.debian.org/debian/ testing main
deb ftp://ftp.fi.debian.org/debian/ unstable main
deb-src ftp://ftp.fi.debian.org/debian/ testing main
deb-src ftp://ftp.fi.debian.org/debian/ unstable main
deb http://security.debian.org/ stable/updates main

Note: Security updates are released against the stable-repository and your geographical mirror will depend on your location. The above example uses Finland as the FTP mirror.

After running apt-get update you will be able to install packages directly from unstable by issuing the command:

apt-get install <package_name> -t unstable

Now the dependencies will be fulfilled primarily from the testing repository and secondarily from the unstable repository. This prioritization is also valid for running normal apt-get update && apt-get upgrade.

No comments:

Post a Comment