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


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