Register APT repository key

Printer-friendly versionPrinter-friendly version

Here is an useful script to register APT keys, to avoid the "There are no public key available for the following key IDs" warning message.

1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/bash
 
# samu 2010-01-01
# (c) 2010 Samuele ~redShadow~ Santi
# redshadow&hackzine.org - http://www.hackzine.org
# Under Gnu GPL v3
 
KEYID="$1"
 
echo "Registering APT key $1..."
gpg --keyserver wwwkeys.eu.pgp.net --recv-keys "$KEYID"
gpg –export –armor "$KEYID" | apt-key add -

I found that script also here: http://kovyrin.net/2006/11/28/debian-problem-apt-get-update/ (and probably, hundreds of debian system administrators wrote that two commands..), where I found in the comments other two methods to do that (but they do not seem to work for everybody..)

The first, from: http://www.debian-administration.org/users/dkg/weblog/11

# apt-get install debian-archive-keyring

or, if you have unstable repositories:

# apt-get install debian-archive-keyring/unstable

Another method, is just to run:

# apt-key update

"This will obtain the necesary keys and import them. No need to go through gpg directly.". Did not test that, but seems definitely the right way to do this..

Who Am I?

~redShadow~ A.K.A. Samuele Santi is an Italian Open Source developer, currently working as a freelance developer, mainly in the web applications sector. Favourite programming languages: PHP and, of course, Python!

alcool (1) archive (1) backup (3) apache (1) curl (1) e-mail (2) circuits (1) aircrack (1) aoe (1) arduino (1) como lake rovers (1) address book (2) cartoons (1) Drupal Forms (1) cryptography (1) debug (1) Drupal (21) database (3) documentation (2) 3d (3) citroen (1) blogroll (7) awstats (3) contact manager (1) doku (1) blender (3) algorythms (1) apt (1) debian (1) bash (11) cocktails (1) C++ (2) dmcrypt (1) caos (1) code (3) 2v (1) audio (1) camera mia (1) development (11) cars (1)