Ubuntu – add repository to ubuntu from terminal with pgp key

monorepositoryserver

How do i add the pgp key from a terminal?

i have added the deb http://badgerports.org lucid main to sources.list
and when i do a sudo apt-get update i get

W: GPG error: http://badgerports.org lucid Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY C90F9CB90E1FAD0C

this is the key i need to add
http://badgerports.org/directhex.ppa.asc

Best Answer

This command will get the public key for the repo :

gpg --keyserver pgpkeys.mit.edu --recv-key C90F9CB90E1FAD0C && gpg --export --armor C90F9CB90E1FAD0C | sudo apt-key add -

It works for any repository, you just have to replace the public key number in the command with the one from the error message.

Related Question