运行`apt update`出现以下错误信息:"GPG 错误:cloud-sdk 未签名"

64
在运行sudo apt update时,会出现以下警告,然后是一个错误。
W: GPG error: http://packages.cloud.google.com/apt cloud-sdk InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY B53DC80D13EDEF05
E: The repository 'http://packages.cloud.google.com/apt cloud-sdk InRelease' is not signed.

有人知道我该怎么解决吗?
1个回答

120

这是一个已知问题。

https://cloud.google.com/compute/docs/troubleshooting/known-issues#keyexpired

运行以下命令以获取最新密钥:

wget https://packages.cloud.google.com/apt/doc/apt-key.gpg \
    && apt-key add apt-key.gpg
或者
curl -O https://packages.cloud.google.com/apt/doc/apt-key.gpg \
    && apt-key add apt-key.gpg

或者...如果你喜欢简单的东西,不需要额外的文件,并且想要冒险尝试:

curl -f https://packages.cloud.google.com/apt/doc/apt-key.gpg \
    | sudo apt-key add -

38
如果您不是超级用户,可以使用以下命令:curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -。这将下载一个 GPG 密钥,并将其添加到适用的软件包管理器中。 - tobltobs
8
我在Ubuntu18上遇到了同样的问题,但这个方法没有解决,它仍然显示以下内容: W: GPG error: https://packages.cloud.google.com/apt cloud-sdk InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 6A030B21BA07F4FB E: The repository 'https://packages.cloud.google.com/apt cloud-sdk 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. 有任何想法吗? - cross_handle
4
这样做对错误信息没有影响。 - Throw Away Account
3
wget https://packages.cloud.google.com/apt/doc/apt-key.gpg && apt-key add apt-key.gpg可能有些变化导致curl无法工作。 - Yan QiDong
50
安装说明中包括curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add -。额外的--keyring参数似乎起到了作用。 - falsePockets
显示剩余6条评论

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接