Search This Blog

Tuesday, July 28, 2009

Ubuntu, Add GPG Key for an Repository

Sometimes we cannot install software (packages) because we do not have the public key for the package.

For example:
W: GPG error: http://ppa.launchpad.net jaunty Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 2836CB0A8AC93F7A

W: You may want to run apt-get update to correct these problems

To solve this, we need to find the public key and import it. (through the key server)

For example, we find the desired public key, my_gpg_file.gpg, which looks like the following

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

mI0ESgMYswEEAOzc0ePR1UkVIg9dZZgl6exOQlr+pAoDIrlEmv1WX977Ciwh9GI6g2KMf3Ci
8DY2jluksPyNWlAtG9rls0NvFyqWkRnRm68Tm8jy+/X7LTfz1YIixoO6xq+8i8YfXoWg0ZaJ
0MjRm2s+jxZmcx199kLC3CL7sS0ui6ZOzXpuMn7FABEBAAG0GUxhdW5jaHBhZCBLdWJ1bnR1
IFVwZGF0ZXOIRgQQEQIABgUCSk7ndwAKCRAiHJXOgzra07LlAJsH8LkuT9HLmTIeubQbMHhf
NsS1nwCglaeK7K1qBxrS7kTIoqNPOmoDdXOItgQTAQIAIAUCSgMYswIbAwYLCQgHAwIEFQII
AwQWAgMBAh4BAheAAAoJECg2ywqKyT96080EAMrywfPZkEa42ROjm6fiJ6hlNI4umiqJ11Vv
myy7PkFFapzjpFq9dIYRkk23PavTRT9nKa97N8jG+Ef4HpLfrxjAb5q+e7Aj3ykEqNcQWXpJ
ppY0TRQDiTMgBJKz3dLgSHFvRk8Rr6FI1i8ZjnkTGJd7YfkynyhA6ACEHVDDLw+s
=VGz5
-----END PGP PUBLIC KEY BLOCK-----

we can import the above key file with:
sudo apt-key add my_gpg_file.gpg

we can see the new added key with:
sudo apt-key list

now we can update our source list with:
sudo apt-get update

then we can upgrade our packages with:
sudo apt-get upgrade

No comments: