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

ale*_*xus 35 debian google-compute-engine google-cloud-platform gcloud

我的环境:

# uname -a
Linux app11 4.9.0-5-amd64 #1 SMP Debian 4.9.65-3+deb9u2 (2018-01-04) x86_64 GNU/Linux
# 
# cat /etc/*release
PRETTY_NAME="Debian GNU/Linux 9 (stretch)"
NAME="Debian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
# 
Run Code Online (Sandbox Code Playgroud)

在尝试运行时apt-get update,我收到了一堆错误:

# apt-get update
Ign:1 http://deb.debian.org/debian stretch InRelease
Hit:2 http://security.debian.org stretch/updates InRelease
Hit:3 http://deb.debian.org/debian stretch-updates InRelease             
Hit:4 http://deb.debian.org/debian stretch-backports InRelease           
Hit:5 http://deb.debian.org/debian stretch Release 
Get:6 http://packages.cloud.google.com/apt cloud-sdk-stretch InRelease [6,377 B]
Ign:7 https://artifacts.elastic.co/packages/6.x/apt stable InRelease
Hit:8 https://artifacts.elastic.co/packages/6.x/apt stable Release
Get:9 http://packages.cloud.google.com/apt google-compute-engine-stretch-stable InRelease [3,843 B]
Get:10 http://packages.cloud.google.com/apt google-cloud-packages-archive-keyring-stretch InRelease [3,876 B]
Hit:11 https://download.docker.com/linux/debian stretch InRelease
Err:6 http://packages.cloud.google.com/apt cloud-sdk-stretch InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 6A030B21BA07F4FB
Err:9 http://packages.cloud.google.com/apt google-compute-engine-stretch-stable InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 6A030B21BA07F4FB
Err:10 http://packages.cloud.google.com/apt google-cloud-packages-archive-keyring-stretch InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 6A030B21BA07F4FB
Fetched 6,377 B in 0s (7,132 B/s)
Reading package lists... Done
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://packages.cloud.google.com/apt cloud-sdk-stretch InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 6A030B21BA07F4FB
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://packages.cloud.google.com/apt google-compute-engine-stretch-stable InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 6A030B21BA07F4FB
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://packages.cloud.google.com/apt google-cloud-packages-archive-keyring-stretch InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 6A030B21BA07F4FB
W: Failed to fetch http://packages.cloud.google.com/apt/dists/cloud-sdk-stretch/InRelease  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 6A030B21BA07F4FB
W: Failed to fetch http://packages.cloud.google.com/apt/dists/google-compute-engine-stretch-stable/InRelease  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 6A030B21BA07F4FB
W: Failed to fetch http://packages.cloud.google.com/apt/dists/google-cloud-packages-archive-keyring-stretch/InRelease  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 6A030B21BA07F4FB
W: Some index files failed to download. They have been ignored, or old ones used instead.
# 
Run Code Online (Sandbox Code Playgroud)

请指教。

ale*_*xus 71

安装 Google Cloud SDK | Cloud SDK 文档- Debian/Ubuntu:

curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add -
Run Code Online (Sandbox Code Playgroud)

或者

curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
Run Code Online (Sandbox Code Playgroud)

遵从:

sudo apt-get update
Run Code Online (Sandbox Code Playgroud)

  • 同样的错误,“NO_PUBKEY FEEA9169307EA071 NO_PUBKEY 8B57C5C2836F4BEB”。那是因为 `google-cloud-sdk.list` 有 `[signed-by=/usr/share/keyrings/cloud.google.gpg]`。因此,您应该更新该密钥环而不是默认密钥环。 (5认同)
  • 在我的系统上,我得到以下输出:`gpg:警告:没有导出 gpg:未找到有效的 OpenPGP 数据。gpg:处理的总数:0` (3认同)

小智 19

curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add -
Run Code Online (Sandbox Code Playgroud)

  • 使用@alexus 方法失败,但此方法适用于 Ubuntu Focal。它看起来像 `--keyring /usr/share/keyrings/cloud.google.gpg` 有所作为。 (4认同)

gen*_*ama 8

接受的答案对我不起作用。

最终我注意到为了安装 google sdk,我使用了以下内容,直接从 google 文档中复制:

echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
sudo apt-get install apt-transport-https ca-certificates gnupg
sudo apt-get update && sudo apt-get install google-cloud-sdk
Run Code Online (Sandbox Code Playgroud)

最后我注意到/etc/apt/sources.list.d/google-cloud-sdk.list有一个 gpg 文件的引用,我认为这可能是有问题的“NO_PUBKEY 6A030B21BA07F4FB”不匹配:

deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main
Run Code Online (Sandbox Code Playgroud)

当我打开 gpg 文件 ( /usr/share/keyrings/cloud.google.gpg) 时,它不存在。所以我编辑google-cloud-sdk.list删除了参考:

deb https://packages.cloud.google.com/apt cloud-sdk main
Run Code Online (Sandbox Code Playgroud)

在那之后,我可以apt-get update毫无问题地进行更新。

稍微偏离主题 - 修复以前的 google sdk 安装

然后我想起使用 snap 安装了 google sdk 和 kubectl,因为我出错了,我希望这可以解决它。安装程序在找不到正确的存储库时建议使用 snap。

我原来的安装命令:

snap install google-cloud-sdk --classic
snap install google-cloud-sdk --classic
Run Code Online (Sandbox Code Playgroud)

因此,我删除了 snap 版本并安装了常规版本。

snap remove google-cloud-sdk
snap remove kubectl
sudo apt-get install kubectl
sudo apt-get install google-cloud-sdk
Run Code Online (Sandbox Code Playgroud)

  • 谢谢您,编辑“/etc/apt/sources.list.d/google-cloud-sdk.list”对我有用。 (2认同)