红联Linux门户
Linux帮助

apt-get无法获取kubelet kubeadm kubectl包

发布时间:2016-11-01 11:17:35来源:linux网站作者:wiborgite
任务场景:
参考Kubernetes官网知道进行安装。
 
错误场景:
root@ubuntu:~# apt-get install -y kubelet kubeadm kubectl kubernetes-cni
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package kubelet
E: Unable to locate package kubeadm
E: Unable to locate package kubectl
E: Unable to locate package kubernetes-cni
 
错误分析:
在执行上述命令前,配置了Kubernetes的apt-get源,需要执行apt-get update命令进行更新,但是更新中有个报错忽略了,重新执行看下报错信息,如下所示:
Get:19 http://security.ubuntu.com/ubuntu xenial-security/universe Translation-en [31.6 kB]
Hit:20 http://us.archive.ubuntu.com/ubuntu xenial-backports InRelease
Err:16 https://packages.cloud.google.com/apt kubernetes-xenial InRelease 
从上述Err:16可以看出Kubernetes对应的包应该是获取不到,需要设置网络才可以。
 
解决办法:
安装了相关网络软件open vpn后,重新执行apt-get命令后不再报错:
Hit:16 http://us.archive.ubuntu.com/ubuntu xenial-backports InRelease
Get:17 https://packages.cloud.google.com/apt kubernetes-xenial InRelease [6,299 B]
Ign:17 https://packages.cloud.google.com/apt kubernetes-xenial InRelease
Get:18 https://packages.cloud.google.com/apt kubernetes-xenial/main amd64 Packages [1,499 B]
Fetched 198 kB in 10s (19.2 kB/s)
Reading package lists... Done
 
本文永久更新地址:http://www.linuxdiyf.com/linux/25629.html