Tips / Linux
APT GPG Key error how to import
Author: Katrame
Visits: 2152
Date: 04.09.2007
Problem, usually when a new repos is added some keys could be missed and an error like this could come up:
# apt-get update
......
Fetched 75362B in 5s (2049B/s)
Reading package lists... Done
W: There are no public key available for the following key IDs:
A70DAF536070D3A1
W: You may want to run apt-get update to correct these problems
#
This tips will let import gpg keys automatically with some apt commands or with a simple bash script:
First method (command line):
Link
# gpg --keyserver wwwkeys.eu.pgp.net --recv-keys A70DAF536070D3A1
# apt-key add /root/.gnupg/pubring.gpg
# apt-get update
NB: A70DAF536070D3A1 is only for example, put your one, usually A70DAF536070D3A1 and Bxxxxx are the keys required from basic debian installation.
Second method (bash script):
From shell edit a new file and put the lines below:
# vi /sbin/apt-get-keys.sh
#!/bin/bash
until [ -z "$1" ]
do
gpg --keyserver pgpkeys.mit.edu --recv-key $1
gpg --keyserver wwwkeys.eu.pgp.net --recv-key $1
gpg -a --export $1 | sudo apt-key add -
shift
done
# chmod +x /sbin/apt-get-keys.sh
After that we could use it:
# /sbin/apt-get-keys.sh KEY
All the steps done in the first method will be applied automatically.
Author: Katrame
Visits: 2152
Date: 04.09.2007
# apt-get update
......
Fetched 75362B in 5s (2049B/s)
Reading package lists... Done
W: There are no public key available for the following key IDs:
A70DAF536070D3A1
W: You may want to run apt-get update to correct these problems
#
This tips will let import gpg keys automatically with some apt commands or with a simple bash script:
First method (command line):
Link
# gpg --keyserver wwwkeys.eu.pgp.net --recv-keys A70DAF536070D3A1
# apt-key add /root/.gnupg/pubring.gpg
# apt-get update
NB: A70DAF536070D3A1 is only for example, put your one, usually A70DAF536070D3A1 and Bxxxxx are the keys required from basic debian installation.
Second method (bash script):
From shell edit a new file and put the lines below:
# vi /sbin/apt-get-keys.sh
#!/bin/bash
until [ -z "$1" ]
do
gpg --keyserver pgpkeys.mit.edu --recv-key $1
gpg --keyserver wwwkeys.eu.pgp.net --recv-key $1
gpg -a --export $1 | sudo apt-key add -
shift
done
# chmod +x /sbin/apt-get-keys.sh
After that we could use it:
# /sbin/apt-get-keys.sh KEY
All the steps done in the first method will be applied automatically.
Page 1 of 1
Se vuoi discutere con noi su questo articolo o comunque vuoi porci delle domande usa il nostro Forum

