apt

GPG error with apt-get update

I came over the error:

Reading package lists... Done
W: GPG error: http://ftp.no.debian.org lenny Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY AED4B06F473041FA
W: You may want to run apt-get update to correct these problems

When running apt-get update .
The solution is actually to do a

apt-get install debian-archive-keyring

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