Debian NO_PUBKEY error

  2009-08-02


aptitude update 是Debian下用得最多的命令之一了,但这个命令有个毛病,还是会报错,往往向人不知道如何处理。

如:

W: GPG error: http://ftp.us.debian.org stable/non-US Release: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY F1D53D8C4F368D5D
W: You may want to run apt-get update to correct these problems

看文字,是说找不到公钥,更新失败。它的建议是使用apt-get update来解决问题,但恰恰这个问题就是这个命令导致的,呵呵。因为apt-get update和aptitude update是基本类似的。aptitude是替代apt-*的新版工具罢了。

Google后,发现有类似问题的人巨多。常见的解决方案是:

# apt-get install gnupg
# gpg –keyserver wwwkeys.eu.pgp.net –recv-keys F1D53D8C4F368D5D
# gpg –armor –export F1D53D8C4F368D5D | apt-key add -

这里的F1D53D8C4F368D5D是错误信息中的那一串。

但是据我测试,这里的关键,wwwkeys.en.pgp.net这个地址,有时并无法正常使用。下面是我收集的一些keyservers,持续更新中。

wwwkeys.eu.pgp.net

pgpkeys.mit.edu

Update 2009/12/31:
更加优雅的解决方案:
apt-get install debian-archive-keyring debian-keyring