解决failure: repodata/repomd.xml from kubernetes: [Errno 256] No more mirrors to try

failure: repodata/repomd.xml from kubernetes: [Errno 256] No more mirrors to try.
https://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64/repodata/repomd.xml: [Errno -1] repomd.xml signature could not be verified for kubernetes

翻译:
失败:repodata/repomd。来自kubernetes的xml:[Errno 256]没有更多镜像可供尝试。
https://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64/repodata/repomd.xml:[Errno-1]报告。无法验证kubernetes的xml签名

一 进行kubelet安装时,运行命令:

yum install -y kubelet kubeadm kubectl --disableexcludes=kubernetes

出现下面提示及错误:

One of the configured repositories failed (Kubernetes),
and yum doesn’t have enough cached data to continue. At this point the only
safe thing yum can do is fail. There are a few ways to work “fix” this:

  1. Contact the upstream for the repository and get them to fix the problem.

  2. Reconfigure the baseurl/etc. for the repository, to point to a working
    upstream. This is most often useful if you are using a newer
    distribution release than is supported by the repository (and the
    packages for the previous distribution release still work).

  3. Run the command with the repository temporarily disabled
    yum --disablerepo=kubernetes …

  4. Disable the repository permanently, so yum won’t use it by default. Yum
    will then just ignore the repository until you permanently enable it
    again or use --enablerepo for temporary usage:
    yum-config-manager --disable kubernetes
    or
    subscription-manager repos --disable=kubernetes

  5. Configure the failing repository to be skipped, if it is unavailable.
    Note that yum will try to contact the repo. when it runs most commands,
    so will have to try and fail each time (and thus. yum will be be much
    slower). If it is a very temporary problem though, this is often a nice
    compromise:

yum-config-manager --save --setopt=kubernetes.skip_if_unavailable=true
failure: repodata/repomd.xml from kubernetes: [Errno 256] No more mirrors to try.
https://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64/repodata/repomd.xml: [Errno -1] repomd.xml signature could not be verified for kubernetes

翻译:

其中一个配置的存储库失败(Kubernetes),
而且yum没有足够的缓存数据来继续。此时,唯一
百胜可以做的安全事情是失败。有几种方法可以解决这个问题:

1.联系上游的存储库,让他们解决问题。
2.重新配置baseurl/等。对于存储库,指向一个工作
上游如果您使用的是更新的
存储库支持的分发版本(以及
上一发行版的软件包仍然有效)。
3.在暂时禁用存储库的情况下运行命令
yum–disablerepo=kubernetes。。
4.永久禁用存储库,因此默认情况下yum不会使用它。百胜
然后将忽略存储库,直到您永久启用它
再次使用或使用–enablerepo临时使用:
yum-config-manager --disable kubernetes
or
subscription-manager repos --disable=kubernetes

5.如果失败的存储库不可用,请将其配置为跳过。
请注意,yum将尝试联系回购。当它运行大多数命令时,
所以每次都必须尝试失败(因此.yum将非常成功
较慢)。如果这是一个非常暂时的问题,这通常是一个很好的
妥协:
yum-config-manager --save --setopt=kubernetes.skip_if_unavailable=true

失败:repodata/repomd。来自kubernetes的xml:[Errno 256]没有更多镜像可供尝试。
https://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64/repodata/repomd.xml:[Errno-1]报告。无法验证kubernetes的xml签名

二 解决方法:出现这个问题的主要原因是阿里的国内yum源出现问题了,应该是文件换路径或升级了,或者原来的文件不存在了;提示提供1-5种解决方案,
此时,只需要修改/etc/yum.repos.d/kubernetes.repo的gpgcheck和repo_gpgcheck参数,要求变为0,见下:

cat <<EOF > /etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=https://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64/
enabled=1
gpgcheck=0
repo_gpgcheck=0
gpgkey=https://mirrors.aliyun.com/kubernetes/yum/doc/yum-key.gpg https://mirrors.aliyun.com/kubernetes/yum/doc/rpm-package-key.gpg
exclude=kubelet kubeadm kubectl
EOF

这样,再次运行yum install -y kubelet kubeadm kubectl --disableexcludes=kubernetes
,即可安装kubelet.

猜你喜欢

转载自blog.csdn.net/helloworldchina/article/details/127392032