W:GPG错误和警告:以下软件包无法通过身份validation!

我得到以下输出sudo apt-get updatesudo apt-get upgrade命令。

 user@user-VPCCB45FN:~$ sudo apt-get update ...... ...... Ign http://in.archive.ubuntu.com trusty-backports/main Translation-en_US Ign http://in.archive.ubuntu.com trusty-backports/multiverse Translation-en_US Ign http://in.archive.ubuntu.com trusty-backports/restricted Translation-en_US Ign http://in.archive.ubuntu.com trusty-backports/universe Translation-en_US Fetched 3,581 kB in 59s (59.9 kB/s) Reading package lists... Done W: GPG error: http://download.virtualbox.org trusty InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 54422A4B98AB5139 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://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://in.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: https://download.01.org trusty InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY A902DDA375E52366 W: GPG error: http://security.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 W: GPG error: http://in.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://in.archive.ubuntu.com trusty-backports 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://ppa.launchpad.net trusty Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY CC079478E5B13347 user@user-VPCCB45FN:~$ sudo apt-get upgrade Reading package lists... Done Building dependency tree Reading state information... Done Calculating upgrade... Done The following packages have been kept back: hostapd The following packages will be upgraded: apport apport-gtk python3-apport python3-problem-report 4 upgraded, 0 newly installed, 0 to remove and 1 not upgraded. Need to get 275 kB of archives. After this operation, 5,120 B of additional disk space will be used. Do you want to continue? [Y/n] y WARNING: The following packages cannot be authenticated! python3-problem-report python3-apport apport apport-gtk Install these packages without verification? [y/N] 

我试着按照现有的解决方案,没有运气:

  1. GPG ERROR NO_PUBKEY:警告:以下软件包无法通过身份validation! [关闭]
  2. 如何修复GPG错误“NO_PUBKEY”?

我怎么解决这个问题?

最后,通过以下步骤解决了这个问题:

 sudo mv /etc/apt/trusted.gpg.d/ /etc/apt/trusted.gpg.d.backup sudo mkdir /etc/apt/trusted.gpg.d sudo chmod 755 /etc/apt/trusted.gpg.d 

然后,对于您需要的每个密钥:

 sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 54422A4B98AB5139 

如无法解决GPG错误链接中所述。