install k8s when yum install kebelet error

6/22/2020

This problem was encountered during the installation of K8S 1.16.4 The prompt says it lacks the dependency of Kubenpilies-CNI 0.7.5

But if you install Kubenpiles-cni 0.7.5 directly using YUM, kubelet 1.18 will be installed automatically complete info

[root@k8s-node-2 yum.repos.d]# yum install -y kubelet-1.16.4-0
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * elrepo: mirrors.tuna.tsinghua.edu.cn
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
Resolving Dependencies
--> Running transaction check
---> Package kubelet.x86_64 0:1.16.4-0 will be installed
--> Processing Dependency: kubernetes-cni >= 0.7.5 for package: kubelet-1.16.4-0.x86_64
Package kubernetes-cni is obsoleted by kubelet, but obsoleting package does not provide for requirements
--> Finished Dependency Resolution

Error: Package: kubelet-1.16.4-0.x86_64 (kubernetes)
           Requires: kubernetes-cni >= 0.7.5
           Available: kubernetes-cni-0.3.0.1-0.07a8a2.x86_64 (kubernetes)
               kubernetes-cni = 0.3.0.1-0.07a8a2
           Available: kubernetes-cni-0.5.1-0.x86_64 (kubernetes)
               kubernetes-cni = 0.5.1-0
           Available: kubernetes-cni-0.5.1-1.x86_64 (kubernetes)
               kubernetes-cni = 0.5.1-1
           Available: kubernetes-cni-0.6.0-0.x86_64 (kubernetes)
               kubernetes-cni = 0.6.0-0
           Available: kubernetes-cni-0.7.5-0.x86_64 (kubernetes)
               kubernetes-cni = 0.7.5-0
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest
-- wang.wenzheng
kubelet
kubernetes

1 Answer

6/22/2020

Same issue we have met today.
i found the yum repo was updated on 6/21, so i suppose this is bug of yum repo.
fixed it by remove cache dir of yum, and copy it from an old server which has been installed k8s already.

rm -rf /var/cache/yum/x86_64/7/kubernetes
scp x.x.x.x:/var/cache/yum/x86_64/7/kubernetes /var/cache/yum/x86_64/7/
-- wilala
Source: StackOverflow