How do I import a public key?

1) You can try this:

gpg --keyserver keyserver.ubuntu.com --recv E084DAB9  

and then:

 gpg --export --armor E084DAB9 | sudo apt-key add - && sudo apt-get update  

2) If "1" doesn't work (you're not alone) then you can use this:

"Some people have reported difficulties using [the first approach]. The issue was usually related to a firewall blocking port 11371. An alternative approach is to search for the key at http://keyserver.ubuntu.com:11371/ and copy the key to a plain text file, say key.txt. Then, feed the key to apt-key with

sudo apt-key add key.txt  

"

As explained here.

To make it easy for this specific case:

Searching for Michael Rutter lead us to:

Public Key Server -- Get ``0x51716619e084dab9 ''

-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: SKS 1.0.10

mQENBEy9tcUBCACnWQfqdrcz7tQL/iCeWDYSYPwXpPMUMLE721HfFH7d8ErunPKPIwq1v4Cr
NmMjcainofbu/BfuZESSK1hBAItOk/5VTkzCJlzkrHY9g5v+XlBMPDQC9u4AE/myw3p52+0N
XsnBz+a35mxJKMl+9v9ztvueA6EmLr2xaLf/nx4XwXUMSi1Lp8i8XpAOz/Xg1fspPMRhuDAG
YDnOh4uH1jADGoqYaPMty0yVEmzx74qvdIOvfgj16A/9LYXk67td6/JQ5LFCZmFsbahAsqi9
inNgBZmnfXO4m4lhzeqNjJAgaw7Fz2zqUmvpEheKKClgTQMWWNI9Rx1L8IKnJkuKnpzHABEB
AAG0I01pY2hhZWwgUnV0dGVyIDxtYXJ1dHRlckBnbWFpbC5jb20+iQE+BBMBAgAoBQJMvbXF
AhsjBQkJZgGABgsJCAcDAgYVCAIJCgsEFgIDAQIeAQIXgAAKCRBRcWYZ4ITauTy9B/4hmPQ7
CSqw5OS5t8U5y38BlqHflqFev3llX68sDtzYfxQuQVS3fxOBoGmFQ/LSfXQYhDG6BZa4nDuD
ZEgb81Mvj0DJDl4lmyMdBoIvXhvdEPDd/rrOG+1t2+S429W9NIObKaZCs9abv2fnIhrtyAWx
c/iNR5rJmNXozvJVGAgAeNhBSrvZqFaPJ//BklbJhfVgNwt4GgtFl1vaU7LMaMrOWA9Hyd8d
WAGuIhbYXOOFj1WZ/OhUlYXnsIe8XzaJ1y6LyVkCLhaJ+MVtGwTXrFXRhBLQlhCYBfO25i/P
GUWSvRhI8n/r+RMNOuy1HlFbexRYrtPXOLbiO8AlFuIsX9nRuQENBEy9tcUBCADYcCgQCCF1
WUSn7c/VXNvgmXzvv3lVX9WkV4QdpcJXitXglXdTZwVxGv3AxDuaLEwxW7rbqKRPzWNjj4xT
Hxt2YtUjE+mLV58AFaQQU3aldYG8JPr2eohMNZqp2BG2odczw5eaO5l5ETjC1nHUjDUm8us3
TV3AXOajAjguGvpG3DKnx/gmudrMBVSAEE64kefyBmSR683zkXhw+NgbTID9XW1OSqE+fLQf
0ZzQEojMdfYIeV8Q5sMAmU3J9AdlpyDrZaYRmiphgw8PZTMahhz/o6Bz7p6VqA4Ncmr225nn
tIsjUUz0iK6TsaOi9KrF23Rw+IDUJeYkdVbwGqavgJG1ABEBAAGJASUEGAECAA8FAky9tcUC
GwwFCQlmAYAACgkQUXFmGeCE2rlB9Qf+JKMUzM0KVdTFWocGP+v4xTJsnKjYfjPjOkFYAdxh
jkiIq7h7ws0s+UKqmzSG4vX5Qz46GZcB7x0hVrN0gqCcfpruPZOjXNkRwtsXbLfiurrZQ6dS
PsNIE9L4DZdSTggwC3i7jiDlK6TtIMXD55VoVvVAvmzt6/f7y4qsVxhZ/N3jMqq1vLUESw8e
Vq2ryZRU9OIUufb5JjGNJ1Zz0Zp8hV/IPLoIv1OIocWov27YLcr6EnXuvXvU/MSm97YifdG9
UYCE99nHTioSM0Q3cgpu5EppVNrc232gyG2vlHzhsstNBx55cUmAX2fEzxuRipLS0iq4L0zU
Gdgdjn4noGDzGA==
=BF1w
-----END PGP PUBLIC KEY BLOCK-----

I) Copy this to a txt file:

gedit ~/Michael.txt  

II) Run this

sudo apt-key add ~/Michael.txt && rm ~/Michel.txt  

Also EvilPhoenix has "got a script that you can install which can allow you to execute the functions described here in a much easier one-line command, its part of a Launchpad project [he] started, the PPA for it is located here.
Its written in Bash, but that is more than enough of a requirement for it to qualify.
Its compatible with all versions of Ubuntu Lucid and later."


sudo apt-key adv --recv-key --keyserver keyserver.ubuntu.com 51716619E084DAB9

To add apt-keys you must use:

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys E084DAB9

Tags:

Gnupg