Review your favorite Linux distribution.
Go Back > Blogs > Notes on Linux
User Name


I leave notes here that I find particularly worth remembering myself.
Rate this Entry

Howto install selected Debian packages from other releases (apt-pinning)

Posted 11-11-2011 at 07:44 AM by bittner

Mixing releases can be necessary when you need a more up-to-date version of a software in a system running on package management and not (yet) providing later package versions.

For example, we need the latest git on your Debian Lenny system, because you updated your Eclipse plugins, and now the git integration refuses to work with your old client. Shoot! Let's check what to do to fix this...

Things to do
  1. Edit /etc/apt/sources.list (or create/edit a file in /etc/apt/sources.list.d/) and add the sources to pull the newer version from, e.g.
    deb sid main contrib non-free
  2. Edit /etc/apt/apt.conf (or create/edit a file in /etc/apt/apt.conf.d/) to define your release default:
    APT::Default-Release "lenny";
  3. Edit /etc/apt/preferences to specify the pinned packages:
    Package: git-core
    Pin: release a=sid
    Pin-Priority: 990
The priority should be between 500 and 990 to prefer the pinned version to the package of the default release.

Double-Checking & Analysis

To visualize the pinning policy run apt-cache policy:
$ apt-cache policy
Append the package name to find out which package candidate will be installed according to the policy:
$ apt-cache policy git-core
We're Ready To Upgrade

When all is configured, and we have optionally checked the upgrade policy, then we can install the pinned software version:
$ apt-get update && apt-get upgrade
... which will now pull the pinned software version. Alternatively, instead of generally upgrading you can use apt-get install to upgrade the specific software package only:
$ apt-get install git-core
The Alternative: Backports

Note that sometimes you can get around apt-pinning using the backports repositories, e.g. for git
deb lenny-backports main
Though, of course, this requires that someone has packaged a newer version of that software for you.

Posted in Uncategorized
Views 2429 Comments 0
« Prev     Main     Next »
Total Comments 0




All times are GMT -5. The time now is 05:46 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration