Priorities for APT repositories (debian-based distributions)

I knew I could pin a package version, setting up an /etc/apt/preferences file, please see
here.
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 Comments to “Priorities for APT repositories (debian-based distributions)”

  1. Just to make sure, the preferences file mentioned above is at:
    /etc/apt/preferences
    and not at:
    /etc/preferences

    Right?

    Great tip, thanks.

  2. 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)

    Thanks,
    BrokenCrystal

  3. @ BrokenCrystal, it’s a feature offered by wp.com: http://faq.wordpress.com/2007/09/03/how-do-i-post-source-code/
    based on a Google Code project by Alex Gorbatchev:
    http://code.google.com/p/syntaxhighlighter/

  4. 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?

  5. 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.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 91 other followers

%d bloggers like this: