Ubuntu更新中的GPG错误

当我运行sudo apt-get update时,会产生以下结果

Reading package lists... Done W: GPG error: http://ppa.launchpad.net lucid Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY A1715D88E1DF1F24 W: GPG error: http://ppa.launchpad.net lucid Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 551CE2FB4CBEDD5A W: GPG error: http://ppa.launchpad.net lucid Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 1E9377A2BA9EF27F 

通过谷歌搜索我发现密钥丢失了,可以通过运行以下命令和相应的hex数来获得密钥

  saikirangvr@ubuntu:~$ sudo gpg --keyserver subkeys.pgp.net --recv 551CE2FB4CBEDD5A 

但我无法解决这个问题,因为这给了我错误

 gpg: WARNING: unsafe ownership on configuration file `/home/saikirangvr/.gnupg/gpg.conf' gpg: external program calls are disabled due to unsafe options file permissions gpg: keyserver communications error: general error gpg: keyserver receive failed: general error 

我尝试了很多次,但我无法修复。 我在我大学的代理服务器后面,我已经配置好Ubuntu以便在代理后面使用。

使用后

  sudo chown -R saikirangvr:saikirangvr /home/saikirangvr/.gnupg 

不安全的所有权问题已经消失,它给出了以下内容……

  sai@ubuntu:~/gpgpu-sim/ispass2009-benchmarks$ gpg --keyserver keyserver.ubuntu.com --recv 1E9377A2BA9EF27F gpg: requesting key BA9EF27F from hkp server keyserver.ubuntu.com gpgkeys: key 1E9377A2BA9EF27F not found on keyserver gpg: no valid OpenPGP data found. gpg: Total number processed: 0 sai@ubuntu:~/gpgpu-sim/ispass2009-benchmarks$ gpg --keyserver subkeys.pgp.net --recv 1E9377A2BA9EF27F gpg: requesting key BA9EF27F from hkp server subkeys.pgp.net gpgkeys: key 1E9377A2BA9EF27F not found on keyserver gpg: no valid OpenPGP data found. gpg: Total number processed: 0 

添加ppa的结果

 sai@ubuntu:~$ sudo add-apt-repository ppa:nilarimogard/webupd8 [sudo] password for sai: Error reading https://launchpad.net/api/1.0/~nilarimogard/+archive/webupd8: Couldn't resolve host 'launchpad.net' 

使用启动板获取键时发生相同的错误

  sai@ubuntu:~$ sudo launchpad-getkeys Please wait... launchpad-getkeys is running an update so it can detect the missing GPG keys Trying to import all the missing keys gpg: requesting key 4C9D234C from hkp server keyserver.ubuntu.com gpgkeys: key 531EE72F4C9D234C not found on keyserver gpg: no valid OpenPGP data found. gpg: Total number processed: 0 gpg: requesting key BA9EF27F from hkp server keyserver.ubuntu.com gpgkeys: key 1E9377A2BA9EF27F not found on keyserver gpg: no valid OpenPGP data found. gpg: Total number processed: 0 launchpad-getkeys has finished importing all missing GPG keys. Try running sudo apt-get update - you shouldn't see any key errors anymore 

问题是什么。 * 有没有其他方法来解决这个问题,如通过GUI * …….

修复.gnupg目录的所有权:

 sudo chown -R saikirangvr:saikirangvr /home/saikirangvr/.gnupg 

之后重复键导入命令。

顺便说一下, gpg命令必须在没有sudo情况下发出,这样你就不会破坏文件的所有权。

请尝试以下方法:

 $ sudo add-apt-repository ppa:nilarimogard/webupd8 $ sudo apt-get update $ sudo apt-get install launchpad-getkeys 

安装后,要导入PPA的所有丢失的GPG密钥,只需使用以下命令:

 $ sudo launchpad-getkeys 

它将运行更新并尝试为您导入所有丢失的GPG密钥。 执行后,希望您没有看到任何GPG错误。

该 link是对解决方案的引用。