I leave notes here that I find particularly worth remembering myself.
Howto install selected Debian packages from other releases (apt-pinning)
Posted 11-11-2011 at 07:44 AM by bittner
Tags administration, debian, package
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
Double-Checking & Analysis
To visualize the pinning policy run apt-cache policy:
Append the package name to find out which package candidate will be installed according to the policy:
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:
... 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:
The Alternative: Backports
Note that sometimes you can get around apt-pinning using the backports repositories, e.g. for git
Though, of course, this requires that someone has packaged a newer version of that software for you.
References
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
- 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.
Code:deb http://ftp.debian.org/debian/ sid main contrib non-free
- Edit /etc/apt/apt.conf (or create/edit a file in /etc/apt/apt.conf.d/) to define your release default:
Code:APT::Default-Release "lenny";
- Edit /etc/apt/preferences to specify the pinned packages:
Code:Package: git-core Pin: release a=sid Pin-Priority: 990
Double-Checking & Analysis
To visualize the pinning policy run apt-cache policy:
Code:
$ apt-cache policy
Code:
$ apt-cache policy git-core
When all is configured, and we have optionally checked the upgrade policy, then we can install the pinned software version:
Code:
$ apt-get update && apt-get upgrade
Code:
$ apt-get install git-core
Note that sometimes you can get around apt-pinning using the backports repositories, e.g. for git
Code:
deb http://backports.debian.org/debian-backports lenny-backports main
References
- Apt-Pinning for Beginners (article by John H. Robinson IV <jaqque@debian.org>)
- Debian Wiki: AptPreferences
- Ubuntu Pinning HowTo
- Apt-pinning policy examples (HowToForge.com)
- /etc/apt/preferences (man page)
Total Comments 0