Apt pinning: installing unstable packages on stable Debian
Minimal sources.list configuration.
/etc/apt/sources.list:
deb http://security.debian.org/ etch/updates main contrib
deb-src http://security.debian.org/ etch/updates main contrib
deb http://ftp.de.debian.org/debian stable main non-free contrib
deb http://ftp.de.debian.org/debian testing main non-free contrib
deb http://ftp.de.debian.org/debian unstable main non-free contrib
When updgrading, stable versions of packages need to stay on stable. unstable versions are usually newer, so they overwrite stable versions if this is not properly handled with using Pin-Priority as stated below. If not explicitly requested, "apt-get install" installs stable version of a package.
/etc/apt/preferences:
Package: *
Pin: release a=stable
Pin-Priority: 700
Package: *
Pin: release a=testing
Pin-Priority: 650
Package: *
Pin: release a=unstable
Pin-Priority: 600
To install f.e. unstable version of a package with dependencies from unstable as well (preferred method, AFAIK), do the following:
apt-get install package -t unstable
To install the same package, but to resolve it's deps from stable:
apt-get install package/unstable
October 24th, 2012 - 22:09
I don’t understand the /etc/apt/preferences part. My Debian system has a preferences.d directory there.. Am I supposed to create a new file simply called “preferences” in /etc/apt/ or what?
December 13th, 2012 - 20:35
Yes, as per http://wiki.debian.org/AptPreferences#Pinning