Adding Public keys for apt-get


When one adds a new repository in sources.list file then there is a high possibility that we face the following error when `apt-get update` command is executed

————————- Error —————–

W: GPG error: http://edevelop.org unstable Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 7E5D69A103CA4243
W: GPG error: http://ftp.debian-unofficial.org sarge Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY D5642BC86823D007
W: There are no public key available for the following key IDs:
B5D0C804ADB11277
W: You may want to run apt-get update to correct these problems
————————————————-

To resolve this issue i have created a script which when provided the KeyID will download the key and add it to your key ring.

---------------------------------- Script ------------------------

gpg --keyserver subkeys.pgp.net --recv-keys $1
gpg --armor --export $1 | sudo apt-key add -
——————————————————————

Advertisements