kubernetes – 与kubeadm相关的apt-get更新错误

我遇到了问题.

我使用的是ubuntu 16.04.我正在按照指南文件,但它不适合我.

# cat /etc/apt/sources.list.d/kubernetes.list
deb http://apt.kubernetes.io/ kubernetes-xenial main

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

# apt-get update
Hit:1 http://kr.archive.ubuntu.com/ubuntu xenial InRelease
Hit:2 http://kr.archive.ubuntu.com/ubuntu xenial-updates InRelease                            
Hit:3 http://kr.archive.ubuntu.com/ubuntu xenial-backports InRelease                                  
Hit:4 http://security.ubuntu.com/ubuntu xenial-security InRelease       
Get:5 https://packages.cloud.google.com/apt kubernetes-xenial InRelease 
[8993 B]
Ign:5 https://packages.cloud.google.com/apt kubernetes-xenial InRelease
Fetched 8993 B in 1s (5258 B/s)
Reading package lists... Done
W: GPG error: https://packages.cloud.google.com/apt kubernetes-xenial 
InRelease: The following signatures couldn't be verified because the public 
key is not available: NO_PUBKEY 6A030B21BA07F4FB
W: The repository 'http://apt.kubernetes.io kubernetes-xenial InRelease' is 
not signed.
N: Data from such a repository can't be authenticated and is therefore 
potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration 
details.

我想升级kubeadm版本.
如何解决这个问题?

最佳答案
您应该尝试从Canonical提供的密钥服务器更新PGP密钥:

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 6A030B21BA07F4FB
Executing: /tmp/apt-key-gpghome.F7OvCVWiqu/gpg.1.sh --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 6A030B21BA07F4FB
gpg: key 6A030B21BA07F4FB: public key "Google Cloud Packages Automatic Signing Key <gc-team@google.com>" imported
gpg: Total number processed: 1
gpg:               imported: 1

下一个:

sudo apt update && sudo apt upgrade 

将完成剩下的工作.

如果问题仍然存在,也可以直接下载二进制文件:

wget https://storage.googleapis.com/kubernetes-release/release/v1.10.1/bin/linux/amd64/kubeadm    
wget https://storage.googleapis.com/kubernetes-release/release/v1.10.1/bin/linux/amd64/kubectl    
wget https://storage.googleapis.com/kubernetes-release/release/v1.10.1/bin/linux/amd64/kubelet

转载注明原文:kubernetes – 与kubeadm相关的apt-get更新错误 - 代码日志