报错日志:
l/var/cache/yum/x86_64/$releasever/docker-ce-stable/repomd.xml
[root@node01 yum.repos.d]# rpm -import http://mirrors.sohu.com/centos/RPM-GPG-KEY-CentOS-7
[root@node01 yum.repos.d]# yum install vim
Loaded plugins: aliases, protectbase
http://mirrors.aliyun.com/centos/%24releasever/os/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found
Trying other mirror.
To address this issue please refer to the below wiki article
https://wiki.centos.org/yum-errors
If above article doesn't help to resolve this issue please use https://bugs.centos.org/.
^Chttp://mirrors.aliyuncs.com/centos/%24releasever/os/x86_64/repodata/repomd.xml: [Errno 14] curl#56 - "Callback aborted"
Trying other mirror.
http://mirrors.cloud.aliyuncs.com/centos/%24releasever/os/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.cloud.aliyuncs.com; Name or service not known"
Trying other mirror.
docker-ce-stable | 3.5 kB 00:00:00
http://mirrors.aliyun.com/centos/%24releasever/extras/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found
Trying other mirror.
^Chttp://mirrors.aliyuncs.com/centos/%24releasever/extras/x86_64/repodata/repomd.xml: [Errno 14] curl#56 - "Callback aborted"
Trying other mirror.
http://mirrors.cloud.aliyuncs.com/centos/%24releasever/extras/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.cloud.aliyuncs.com; Name or service not known"
Trying other mirror.
One of the configured repositories failed (CentOS-$releasever - Extras - mirrors.aliyun.com),
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=extras ...
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 extras
or
subscription-manager repos --disable=extras
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=extras.skip_if_unavailable=true
failure: repodata/repomd.xml from extras: [Errno 256] No more mirrors to try.
http://mirrors.aliyun.com/centos/$releasever/extras/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found
http://mirrors.aliyuncs.com/centos/$releasever/extras/x86_64/repodata/repomd.xml: [Errno 14] curl#56 - "Callback aborted"
http://mirrors.cloud.aliyuncs.com/centos/$releasever/extras/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.cloud.aliyuncs.com; Name or service not known"
问题描述:
我在安装CDH时安装失败后,我删除了CDH相关的配置,误删了一些系统配置文件,然后在使用yum安装vim插件时报错
解决方案:
于是我换成了aliyun的镜像,之后无论是执行 yum clean all / yum update 都会有报错
当然我们如果有经验的开发者会一眼发现问题之所在:
http://mirrors.aliyuncs.com/centos/$releasever/extras/x86_64/repodata/repomd.xml: [Errno 14] curl#56 - "Callback aborted"
这个镜像地址有个很重要的信息:$releasever
这是一个系统版本的引用变量,结果是引用失败的,
正确地址应该是(我的操作系统是centos7):
http://mirrors.aliyuncs.com/centos/7/extras/x86_64/repodata/repomd.xml
我对 /etc/yum.repos.d/CentOS-Base.repo 这个文件进行了更改
把所有的系统引用变量($releasever )改为你的系统版本即可
问题就此解决