由于公钥不可用,无法验证以下签名:NO_PUBKEY 3B4FE6ACC0B21F32

由于公钥不可用,无法验证以下签名:NO_PUBKEY 3B4FE6ACC0B21F32

我遇到了无法解决的严重密钥问题。Apt 一直告诉我,我没有可以验证的密钥。这个问题的正常答案 99% 是使用 apt-key 添加丢失的密钥。但是,这在这台机器上不起作用,我不知道为什么。请参见下文,因为命令比我在这里描述的更能描述问题。

编辑: 不要建议使用 apt-key add 来修复。这不是这里的问题。请注意,密钥已列在 apt-key 列表中。由于密钥存在,我怀疑问题在于尝试读取密钥文件本身(可能是权限问题),但我不知道在哪里或寻找什么来检查

Get:2 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]                    
Get:1 http://us.archive.ubuntu.com/ubuntu bionic InRelease [242 kB]                            
Get:3 http://us.archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]                                   
Get:4 http://us.archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]      
Err:2 http://security.ubuntu.com/ubuntu bionic-security InRelease                   
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32
Get:5 http://ppa.launchpad.net/git-core/ppa/ubuntu bionic InRelease [20.8 kB]
Err:1 http://us.archive.ubuntu.com/ubuntu bionic InRelease                   
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32
Err:3 http://us.archive.ubuntu.com/ubuntu bionic-updates InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32
Get:6 http://ppa.launchpad.net/ondrej/php/ubuntu bionic InRelease [20.8 kB]
Err:4 http://us.archive.ubuntu.com/ubuntu bionic-backports InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32
Err:5 http://ppa.launchpad.net/git-core/ppa/ubuntu bionic InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY A1715D88E1DF1F24
Err:6 http://ppa.launchpad.net/ondrej/php/ubuntu bionic InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 4F4EA0AAE5267A6C
Reading package lists... Done
W: GPG error: http://security.ubuntu.com/ubuntu bionic-security InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32
E: The repository 'http://security.ubuntu.com/ubuntu bionic-security InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: http://us.archive.ubuntu.com/ubuntu bionic InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32
E: The repository 'http://us.archive.ubuntu.com/ubuntu bionic InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: http://us.archive.ubuntu.com/ubuntu bionic-updates InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32
E: The repository 'http://us.archive.ubuntu.com/ubuntu bionic-updates InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: http://us.archive.ubuntu.com/ubuntu bionic-backports InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32
E: The repository 'http://us.archive.ubuntu.com/ubuntu bionic-backports InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: http://ppa.launchpad.net/git-core/ppa/ubuntu bionic InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY A1715D88E1DF1F24
E: The repository 'http://ppa.launchpad.net/git-core/ppa/ubuntu bionic InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: http://ppa.launchpad.net/ondrej/php/ubuntu bionic InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 4F4EA0AAE5267A6C
E: The repository 'http://ppa.launchpad.net/ondrej/php/ubuntu bionic InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.



root@Work-VirtualBox /etc/apt # apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 3B4FE6ACC0B21F32
Executing: /tmp/apt-key-gpghome.23cQALOxzT/gpg.1.sh --recv-keys --keyserver keyserver.ubuntu.com 3B4FE6ACC0B21F32
gpg: key 3B4FE6ACC0B21F32: 21 signatures not checked due to missing keys
gpg: key 3B4FE6ACC0B21F32: "Ubuntu Archive Automatic Signing Key (2012) <[email protected]>" not changed
gpg: Total number processed: 1
gpg:              unchanged: 1


root@Work-VirtualBox /etc/apt # apt-key list
/etc/apt/trusted.gpg
--------------------
pub   rsa4096 2012-05-11 [SC]
      790B C727 7767 219C 42C8  6F93 3B4F E6AC C0B2 1F32
uid           [ unknown] Ubuntu Archive Automatic Signing Key (2012) <[email protected]>

pub   rsa1024 2009-01-22 [SC]
      E1DD 2702 88B4 E603 0699  E45F A171 5D88 E1DF 1F24
uid           [ unknown] Launchpad PPA for Ubuntu Git Maintainers

pub   rsa1024 2009-01-26 [SC]
      14AA 40EC 0831 7567 56D7  F66C 4F4E A0AA E526 7A6C
uid           [ unknown] Launchpad PPA for Ondřej Surý


root@Work-VirtualBox /etc/apt # apt-get update
Get:3 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]                           
Get:1 http://us.archive.ubuntu.com/ubuntu bionic InRelease [242 kB]            
Get:2 http://us.archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]                                  
Get:4 http://us.archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]      
Err:3 http://security.ubuntu.com/ubuntu bionic-security InRelease                   
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32
Get:5 http://ppa.launchpad.net/git-core/ppa/ubuntu bionic InRelease [20.8 kB]
Err:1 http://us.archive.ubuntu.com/ubuntu bionic InRelease                   
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32
Err:2 http://us.archive.ubuntu.com/ubuntu bionic-updates InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32
Get:6 http://ppa.launchpad.net/ondrej/php/ubuntu bionic InRelease [20.8 kB]
Err:4 http://us.archive.ubuntu.com/ubuntu bionic-backports InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32
Err:5 http://ppa.launchpad.net/git-core/ppa/ubuntu bionic InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY A1715D88E1DF1F24
Err:6 http://ppa.launchpad.net/ondrej/php/ubuntu bionic InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 4F4EA0AAE5267A6C
Reading package lists... Done
W: GPG error: http://security.ubuntu.com/ubuntu bionic-security InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32
E: The repository 'http://security.ubuntu.com/ubuntu bionic-security InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: http://us.archive.ubuntu.com/ubuntu bionic InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32
E: The repository 'http://us.archive.ubuntu.com/ubuntu bionic InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: http://us.archive.ubuntu.com/ubuntu bionic-updates InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32
E: The repository 'http://us.archive.ubuntu.com/ubuntu bionic-updates InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: http://us.archive.ubuntu.com/ubuntu bionic-backports InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32
E: The repository 'http://us.archive.ubuntu.com/ubuntu bionic-backports InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: http://ppa.launchpad.net/git-core/ppa/ubuntu bionic InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY A1715D88E1DF1F24
E: The repository 'http://ppa.launchpad.net/git-core/ppa/ubuntu bionic InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: http://ppa.launchpad.net/ondrej/php/ubuntu bionic InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 4F4EA0AAE5267A6C
E: The repository 'http://ppa.launchpad.net/ondrej/php/ubuntu bionic InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

答案1

我自己解决了这个问题!我猜想这是权限问题,这是正确的。我盲目地尝试了一下,然后运行:

sudo bash
cd /etc/apt
chmod -R 755 .
apt-get update (At this point it began to work!)
exit

因此,如果您尝试过 apt-key add 但没有成功,也许这个对您有用。我不知道这些权限是如何被提升的,但这似乎解决了问题。

相关内容