Priorities for APT repositories (debian-based distributions)

I knew I could pin a package version, setting up an /etc/apt/preferences file, please see
newtonfn on the ubuntuforums elegantly worked this resource out to set up a priority to repositories as well.
In this particular example, the medibuntu repos are set to have a lower priority, so that any package present in two repos from the /etc/apt/sources.list (here, medibuntu and skype) gets installed and upgraded preferably from the other repo (the skype one in the example):

Package: * 
Pin: release l=Medibuntu
Pin-Priority: 400

A package present only in the medibuntu repo will be installed/upgraded from medibuntu. As I said, very elegant!

About these ads

6 thoughts on “Priorities for APT repositories (debian-based distributions)

  1. How did you get that code displayed like that? I would like to do that on my Ubuntu page… (The numbered lines with the menu above the code)


  2. Simon says:

    I’ve been trying to use this method, but I’m somewhat disconcerted by the fact that the output of apt-cache policy does not reflect contents /etc/apt/preferences …

    Does this actually work?

  3. It did work when I wrote the post, I used it. It was a while ago, and I switched computers and upgraded since then. I have not used it recently, I’ll check, thanks.

Comments are closed.