GPG错误NO_PUBKEY:警告:以下软件包无法进行身份验证!

我刚开始收到一些关于GPG密钥的奇怪错误。具体来说,我刚刚添加了ppa:ubuntu-toolchain-r/test并想要更新,结果出现了以下错误:
W: GPG error: http://extras.ubuntu.com trusty Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 16126D3A3E5C1192
W: GPG error: http://archive.canonical.com trusty Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 40976EAF437D05B5 NO_PUBKEY 3B4FE6ACC0B21F32
W: GPG error: http://qgis.org trusty InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 030561BEDD45F6C3
W: GPG error: http://dl.google.com stable Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY A040830F7FAC5991
W: GPG error: http://dl.google.com stable Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY A040830F7FAC5991
W: GPG error: http://archive.ubuntu.com trusty Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 40976EAF437D05B5 NO_PUBKEY 3B4FE6ACC0B21F32
W: GPG error: http://archive.ubuntu.com trusty-updates Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 40976EAF437D05B5 NO_PUBKEY 3B4FE6ACC0B21F32
W: GPG error: http://archive.ubuntu.com trusty-security Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 40976EAF437D05B5 NO_PUBKEY 3B4FE6ACC0B21F32

我已经尝试了两种方法来解决这个问题(请点击这里)。
for key in 40976EAF437D05B5 3B4FE6ACC0B21F32 A040830F7FAC5991 030561BEDD45F6C3 16126D3A3E5C1192  ; do sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys $key ; done

但是那并没有帮助(相同的错误仍然出现在相同的键上),所以我尝试了这样做:
sudo add-apt-repository ppa:webupd8team/y-ppa-manager
sudo apt-get update
sudo apt-get install y-ppa-manager

但是我得到了这个,让我大开眼界:
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  launchpad-getkeys libvte-common libvte9 python-keyring python-launchpadlib
  python-lazr.restfulclient python-lazr.uri python-oauth python-secretstorage
  python-simplejson python-vte python-wadllib xclip yad
Suggested packages:
  python-gdata python-keyczar python-kde4 python-testresources
  python-secretstorage-doc
The following NEW packages will be installed:
  launchpad-getkeys libvte-common libvte9 python-keyring python-launchpadlib
  python-lazr.restfulclient python-lazr.uri python-oauth python-secretstorage
  python-simplejson python-vte python-wadllib xclip y-ppa-manager yad
0 upgraded, 15 newly installed, 0 to remove and 29 not upgraded.
Need to get 915 kB of archives.
After this operation, 4,515 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
WARNING: The following packages cannot be authenticated!
  libvte-common libvte9 python-keyring python-lazr.uri python-simplejson
  python-wadllib python-oauth python-lazr.restfulclient python-launchpadlib
  python-secretstorage python-vte xclip
Install these packages without verification? [y/N]

4尝试执行以下命令:sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys <KEY>。例如:sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 40976EAF437D05B5 - g_p
我尝试过,但那时候没有起作用。请检查我的答案。 - Patryk
2这实质上是一个错误报告,您在其中描述了一个问题,并且作为答案引用了该错误报告。该错误报告本身适用于已经过期的13.10版本。如果您正在使用13.10版本,我建议您升级到最新版本。如果您正在使用当前版本的Ubuntu,我建议您提交一个新的错误报告,因为旧的报告已经过时。在新报告中引用旧报告。 - Panther
可能是如何修复GPG错误"NO_PUBKEY"?的重复问题。 - Eliah Kagan
1个回答

运行命令:

sudo apt-get update

对于每个报告为丢失的16字符密钥,请使用替换后的密钥运行以下操作:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys ABCDEFGH12345678

2我遇到以下错误:gpgkeys: 无法获取密钥 1DB8ADC1CFCA9579gpg: 未找到有效的 OpenPGP 数据。我该怎么办? - a06e
3如果 apt-get update 没有报告丢失的密钥会怎样? - harayz