添加新密钥仍然会引发错误,如何删除子 apt-key

添加新密钥仍然会引发错误,如何删除子 apt-key

安装纱线包管理器从其操作说明我确实添加了它的密钥,但几周前密钥就过期了。所以我又做了apt-key add一次。但仍然sudo apt update收到警告:

W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://dl.yarnpkg.com/debian stable InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 4F77679369475BAA
W: Failed to fetch https://dl.yarnpkg.com/debian/dists/stable/InRelease  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 4F77679369475BAA
W: Some index files failed to download. They have been ignored, or old ones used instead.

sudo apt-key list显示有两个密钥,其中一个已过期

    pub   rsa4096 2016-10-05 [SC]
      72EC F46A 56B4 AD39 **** **** **** **** **** ****
    uid           [ unknown] Yarn Packaging <[email protected]>
    sub   rsa4096 2016-10-05 [E]
    sub   rsa4096 2019-01-02 [S] [expires: 2020-02-02]

我怎样才能删除已过期的那个?

答案1

请尝试此处解决此问题,更新密钥以添加错误消息中提到的丢失的密钥。

如何修复丢失的 GPG 密钥?

答案2

如果即使在较新的版本中仍然收到此错误,则只是签名密钥发生了变化,您应该通过以下方式手动添加它:添加最新密钥:

wget -qO - https://raw.githubusercontent.com/yarnpkg/releases/gh-pages/debian/pubkey.gpg | sudo apt-key add -

或者

curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -

相关内容