最近新安装了centos,但是在更新镜像时,总是出错,折腾了1个多小时终于解决了。
问题描述:
按照网上说的方法,下载新的yum镜像文件****.repo, 然后使用yum clean all,然后yum makecache
结果显示:file:///media/CentOS/repodata/repomd.xml: [Errno 14] Could not open/read file:///media/CentOS/repodata/repomd.xml
Trying other mirror.
file:///media/cdrom/repodata/repomd.xml: [Errno 14] Could not open/read file:///media/cdrom/repodata/repomd.xml
Trying other mirror.
file:///media/cdrecorder/repodata/repomd.xml: [Errno 14] Could not open/read file:///media/cdrecorder/repodata/repomd.xml
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: c6-media. Please verify its path and try again
开始以为是镜像源不对,更换了好多个.repo文件,结果总是重复出现同样的错误。
最后终于发现了错误:在/etc/yum.repos.d目录下,存在CentOS-Media.repo文件,原来只要在/etc/yum.repos.d目录下含有.repo文件,都要更新一下该文件中的url所指向的文件,因此一直出现一直出错。将该文件改为.repo.bak就可以了
最后
以上就是鳗鱼小蘑菇最近收集整理的关于centos更新镜像源问题的全部内容,更多相关centos更新镜像源问题内容请搜索靠谱客的其他文章。
发表评论 取消回复