Download PGP Keys with Apt-key

Posted by admin on December 1, 2009 under Tech Tips | 2 Comments to Read

When adding third party software repositories to your APT sources list, you can easily download a referenced PGP key to your APT keyring using the advanced options of the apt-key utility.

For example, if you are adding a third party repository that references the PGP key ID of 6E80C6B7, the following will work as long as the key has been uploaded to a keyserver.

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 6E80C6B7
gpg: requesting key 6E80C6B7 from hkp server keyserver.ubuntu.com
gpg: key 6E80C6B7: public key "Launchpad PPA for Banshee Team" imported
gpg: no ultimately trusted keys found
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)

Typically, instructions on adding repositories give readers a two or three step process that involves apt-key reading a key from a text file or piped from a wget command. The above just cuts all that nonsense out.

The apt-key man page is a bit bare, but there are a few other options you might find interesting that are only mentioned in the commands help output.

apt-key
Usage: apt-key [command] [arguments]

Manage apt's list of trusted keys

apt-key add - add the key contained in ('-' for stdin)
apt-key del - remove the key
apt-key export - output the key
apt-key exportall - output all trusted keys
apt-key update - update keys using the keyring package
apt-key net-update - update keys using the network
apt-key list - list keys
apt-key finger - list fingerprints
apt-key adv - pass advanced options to gpg (download key)

Be Sociable, Share!

Comments

  • Chris S said,

    Also you can import keys using seahorse. Select menu Application, Accessories, Passwords and Encryption keys.

    Use the Find Remote keys and paste in the ID. After it finds it click Import.

    First time you do this you likely need to select Preferences to add the keyserver.ubuntu.com:11371 as the default keyserver to use. I know for me it was not in there by default.

  • Milford said,

    Comfort Inn North: 12000 points from April 16, 2011 to June 30, 20011 & 10000 points from July 1, 2011 to
    September 15, 2011. Luxury hotels, and also budget hotels appear in Vegas.
    This can help which you decide in case you should utilize the phone,
    or use your personal personal cell phone.

Add A Comment