Pin a package to prevent apt from upgrading it

I got a rdesktop package from a specific ubuntu ppa repo that fixed a bug, the fix hasn’t made it into the official ubuntu repo for some unknown (to me) reason. I install my local package with dpkg but apt-get upgrade always upgrades that package and I have to do it all over. I remember pinning a package in Debian some years back, so I tried the same solution on my Ubuntu Natty setup.

joar@jupiter:~$ cat /etc/apt/preferences.d/rdesktop
Package: rdesktop
Pin: version 1.6.0-2ubuntu3ppa1*
Pin-Priority: 1001

joar@jupiter:~$ 

As you can see I created a /etc/apt/preferences.d/rdesktop preferences file, and now my apt-get upgrade leaves redesktop to the version I’ve installed with dpkg. 🙂
More info regarding pinning in :

$ man 5 apt_preferences

One comment on “Pin a package to prevent apt from upgrading it

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

This site uses Akismet to reduce spam. Learn how your comment data is processed.