There is no public key available for the following key IDs

in 操作系统 with 0 comment

在对一台Debian服务器执行更新时,发生如下错误:

infosource:/etc/apt# aptitude update
Hit ftp://ftp3.tsinghua.edu.cn stable Release.gpg
Hit ftp://ftp3.tsinghua.edu.cn stable/updates Release.gpg
Get:1 ftp://ftp3.tsinghua.edu.cn stable Release [63.2kB]
Hit ftp://ftp3.tsinghua.edu.cn stable/updates Release
Get:2 ftp://ftp3.tsinghua.edu.cn stable/main Packages/DiffIndex
Ign ftp://ftp3.tsinghua.edu.cn stable/main Packages/DiffIndex
Get:3 ftp://ftp3.tsinghua.edu.cn stable/contrib Packages/DiffIndex
Ign ftp://ftp3.tsinghua.edu.cn stable/contrib Packages/DiffIndex
Get:4 ftp://ftp3.tsinghua.edu.cn stable/main Sources/DiffIndex
Ign ftp://ftp3.tsinghua.edu.cn stable/main Sources/DiffIndex
Get:5 ftp://ftp3.tsinghua.edu.cn stable/contrib Sources/DiffIndex
Ign ftp://ftp3.tsinghua.edu.cn stable/contrib Sources/DiffIndex
Hit ftp://ftp3.tsinghua.edu.cn stable/main Packages
Get:6 ftp://ftp3.tsinghua.edu.cn stable/updates/main Packages/DiffIndex
Ign ftp://ftp3.tsinghua.edu.cn stable/updates/main Packages/DiffIndex
Hit ftp://ftp3.tsinghua.edu.cn stable/contrib Packages
Get:7 ftp://ftp3.tsinghua.edu.cn stable/main Sources
Err ftp://ftp3.tsinghua.edu.cn stable/main Sources
  Unable to fetch file, server said 'Can't open /mirror/debian/debian/dists/stable/main/source/Sources.gz: No such file or directory  '
Get:8 ftp://ftp3.tsinghua.edu.cn stable/contrib Sources
Err ftp://ftp3.tsinghua.edu.cn stable/contrib Sources
  Unable to fetch file, server said 'Can't open /mirror/debian/debian/dists/stable/contrib/source/Sources.gz: No such file or directory  '
Hit ftp://ftp3.tsinghua.edu.cn stable/updates/main Packages
Fetched 63.2kB in 0s (389kB/s)
Reading package lists... Done
W: There is no public key available for the following key IDs:
4D270D06F42584E6
W: You may want to run apt-get update to correct these problems

在因特网上google了一下,找到相关文档: http://www.linuxquestions.org/questions/debian-26/there-is-no-public-key...
其中介绍了二种方法,一种方法如下:

Try this as root:
# gpg --recv-keys 4D270D06F42584E6
# gpg --export 4D270D06F42584E6 | apt-key add -
That should download the key from a public keyserver and then the second command adds it to apt. You may need to specify a keyserver if the default doesn't work. There are several public ones available.

另一种方法似乎更为简单:

# apt-get install debian-keyring debian-archive-keyring
# apt-key update

尝试了第二种方法,成功解决了public key的问题。

Comments are closed.