Ubuntu 更新中出现 GPG 错误

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

通过谷歌搜索,我发现密钥丢失了,可以通过运行以下命令和相应的十六进制数字来获取它

 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 *.......

答案1

请尝试以下操作:

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

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

$ sudo launchpad-getkeys

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

关联是对解决方案的引用。

答案2

修复目录的所有权.gnupg

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

之后重复密钥导入命令。

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

相关内容