阿里云centos yum源 问题处理-在安装docker容器出现的问题
问题初次出现,在安装docker容器,修改yum源之后,一系列胡乱操作(具体怎么操作的我也忘了),最终结果导致docker无法安装,yum无法使用:Repository 'epel' is missing name in configuration, using idbase...
问题初次出现,在安装docker容器,修改yum源之后,一系列胡乱操作(具体怎么操作的我也忘了),最终结果导致docker无法安装,yum无法使用:
Repository 'epel' is missing name in configuration, using id
base | 3.6 kB 00:00:00
epel | 5.4 kB 00:00:00
extras | 3.4 kB 00:00:00http://mirrors.ustc.edu.cn/docker-/repodata/repomd.xml: [Errno 12] Timeout on http://mirrors.ustc.edu.cn/docker-/repodata/repomd.xml: (28, 'Operation too slow. Less than 1000 bytes/sec transferred the last 30 seconds')
Trying other mirror.
http://mirrors.ustc.edu.cn/docker-/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found
Trying other mirror.
To address this issue please refer to the below wiki articlehttps://wiki.centos.org/yum-errors
If above article doesn't help to resolve this issue please use https://bugs.centos.org/.
One of the configured repositories failed (added from: http://mirrors.ustc.edu.cn/docker-),
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=mirrors.ustc.edu.cn_docker- ...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 mirrors.ustc.edu.cn_docker-
or
subscription-manager repos --disable=mirrors.ustc.edu.cn_docker-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=mirrors.ustc.edu.cn_docker-.skip_if_unavailable=true
failure: repodata/repomd.xml from mirrors.ustc.edu.cn_docker-: [Errno 256] No more mirrors to try.
http://mirrors.ustc.edu.cn/docker-/repodata/repomd.xml: [Errno 12] Timeout on http://mirrors.ustc.edu.cn/docker-/repodata/repomd.xml: (28, 'Operation too slow. Less than 1000 bytes/sec transferred the last 30 seconds')
http://mirrors.ustc.edu.cn/docker-/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found
附上图片:
然后,在网上尝试了各种方法:
1 、修改 /etc/yum/pluginconf.d/fastestmirror.conf 配置文件:enable=1 改成enable=0
/ect/yum.conf 将plugins=1改成0 禁用插件
(该方法尝试无效,替换其他方法)
2、更换yum源:
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo。通过wget更换yum源,如果本机未安装wget,肯定行不通。。。。但是,我还是不行,更换yum源之后依然是同样的错误,继续尝试其他方法。
3、通过搜索查询出来目前最有效的一种方法:重新下载安装yum源
在网上找到一个资源:
链接: https://pan.baidu.com/s/1FBEMkcMajzW_ijPPvse_gA
提取码: n9su
通过ftp将文件传输到服务器,执行安装
rpm -ivh rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm。
yum clean all //清除yum缓存
yum makecache //缓存软件包到本地
yum update //更新所有yum包
yum list //查看yum
此方法较为麻烦,因此本人并未进行尝试(懒)。
4、在不断努力之后没发现错误提示里有一句关键的提示:
Repository 'epel' is missing name in configuration, using id
存储库“epel”在配置中缺少名称,使用id。意思就是在配置文件epel中找不到name,name是为什么呢,打开epel的配置文件,发现name属性写错了,写成了namei。修改之后,再次尝试
尝试之后出现了新的错误。
发现是docker的源除了问题,导致yum无法更新。怎么办呢,继续寻找docker的yum源配置文件。
[mirrors.ustc.edu.cn_docker-]
name=added from: http://mirrors.ustc.edu.cn/docker-
baseurl=http://mirrors.ustc.edu.cn/docker-
enabled=1
发现在配置文件中,我们的源一直是mirrors.ustc.edu.cn,我曾经无数次改过docker的源,将它改成阿里镜像的地址(并没起作用) 。手动修改试一试,直接删掉此文件,重新创建一个阿里镜像的配置文件。
rm -f mirrors.ustc.edu.cn_docker-.repo
sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo.
终于结束了,最终找到了根本原因,是docker源出了问题。在此,各位猿友一定要仔细看报错的提示信息的配置文件,所有的问题都能在这些地方找到发生的原因。
ps:-- 查看当前安装了哪些yunm源。yum repolist all
更多推荐
所有评论(0)