Skip to content

Apt-key gpg tip

2009 March 19
tags: , ,
by Philippe Delodder

How many times you have stumbled on a mistake like this?

W: GPG error: <repository address> jaunty Release: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY 2A8E3034D018A4CE

NOTE: This is in away unsecure as pointed out in here : Dealing with apt’s GPG signing stuff — the right way. In the following link you can read up on how to do it the real way.

gpg --keyserver subkeys.pgp.net --recv-key fingerprint

For Debian:

gpg --export fingerprint | apt-key add -

For Ubuntu:

gpg --export fingerprint | sudo apt-key add -

But you can put this easy in a script:

For Ubuntu:

#!/bin/bash
gpg --keyserver subkeys.pgp.net --recv-key $1
gpg --export $1 | sudo apt-key add -

For Debian:

#!/bin/bash
gpg --keyserver subkeys.pgp.net --recv-key $1
gpg --export $1 | apt-key add -

You can run it as following:  fixgpg.sh 2A8E3034D018A4CE .

I placed it in /usr/bin, the script is easily called and solved, plus you don’t have to remember the code ;) .

No comments yet

Leave a Reply

Note: You can use basic XHTML in your comments. Your email address will never be published.

Subscribe to this comment feed via RSS

Bad Behavior has blocked 116 access attempts in the last 7 days.