wholesale jerseys nba jersey discounts ncaa college jerseys nfl cheap jerseys with free shipping nfl authentic football jerseys new york giants apparel cheap wholesale jerseys

How to fix up “GPG error” & “NO_PUBKEY” error when “apt-get update”

no_pubkey

sometimes when we excute "apt-get update", we get this error "W: GPG error: http://extras.ubuntu.com precise Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY XXXXXXXXXXXXXXXX" . This is caused by a missing key. We can just simply excute the following to solve the problem.

apt-get update 2> /tmp/keymissing; for key in $(grep "NO_PUBKEY" /tmp/keymissing |sed "s/.*NO_PUBKEY //"); do echo -e "\nProcessing key: $key"; gpg --keyserver subkeys.pgp.net --recv $key && sudo gpg --export --armor $key | apt-key add -; done

 


make a comment

(opt)