Debian

由於公鑰不可用,無法驗證以下簽名:NO_PUBKEY 6A030B21BA07F4FB

  • December 7, 2021

我的環境:

# 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/"
# 

在嘗試執行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.
# 

請指教。

安裝 Google Cloud SDK | 雲 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 -

或者

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

遵從:

sudo apt-get update
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add -

引用自:https://serverfault.com/questions/906972