Debian – Enabling apt Repository Priority in LMDE

aptdebianlinux-mint

I want to set up apt repository priority ordering in Linux Mint Debian Edition 2012.04. In /etc/apt/preferences the order should be: LMDE -> Debian testing -> Debian unstable. In other words, I almost always want to use packages from LMDE semi-rolling repository, and only sometimes get them from testing and unstable only when absolutely necessary.

I looked at http://forums.linuxmint.com/viewtopic.php?f=201&t=78882 and http://forums.linuxmint.com/viewtopic.php?f=141&p=379226, but still have not been able to get repository priority ordering to work correctly.

What is the best way to do this?

Best Answer

It seems that i succeeded at apt-pinning (setting apt repository priority) on LMDE. My /etc/apt/sources.list currently looks like this:

deb http://packages.linuxmint.com/ debian main upstream import
deb http://debian.linuxmint.com/latest testing main contrib non-free
deb http://debian.linuxmint.com/latest/security testing/updates main contrib non-free
deb http://debian.linuxmint.com/latest/multimedia testing main non-free

deb http://ftp.us.debian.org/debian/ testing main contrib non-free
deb http://ftp.us.debian.org/debian/ unstable main contrib non-free
deb http://ftp.us.debian.org/debian/ experimental main contrib non-free

My /etc/apt/preferences looks like this:

Package: *
Pin: origin packages.linuxmint.com
Pin-Priority: 900

Package: *
Pin: origin debian.linuxmint.com
Pin-Priority: 700

Package: *
Pin: release a=testing
Pin-Priority: 600

Package: *
Pin: release a=unstable
Pin-Priority: 200

Package: *
Pin: release a=experimental
Pin-Priority: 50

So sudo aptitude allows only packages originating from linuxmint.com to install, and to install packages from Debian distribution, i need to append -t <distribution>, where distribution is testing, unstable or experimental.

Sources:

Related Question