【Redhat7.0】yum makecache报错的解决方法(巨坑!!!)

网友投稿 310 2022-11-23

【Redhat7.0】yum makecache报错的解决方法(巨坑!!!)

执行时报错: failure: repodata/repomd.xml from base: [Errno 256] No more mirrors to try. [Errno 14] HTTP Error 404 - Not Found 本来是想更换yum源,然后就删除了linux中 /etc/yum.repos.d除CentOS-Base.repo文件以外的所有文件 首先,根据http://mirrors.163.com/.help/centos.html指示备份 mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup 然后下载对应版本repo文件, 放入/etc/yum.repos.d/ 我下载的是CentOS7 运行以下命令生成缓存 yum clean all yum makecache 但是执行yum makecache时出现上述错误。 然后在网上搜了一通。 试了n个解决方法,都没有一个对应的。 好几个小时,终于改好了。 就是把下载的CentOS7对应的repo文件中的$releasever全部改成对应版本7,并且把不存在的网址的子路径删去即可。 修改后如下: # CentOS-Base.repo # # The mirror system uses the connecting IP address of the client and the # update status of each mirror to pick mirrors that are updated to and # geographically close to the client. You should use this for CentOS updates # unless you are manually picking other mirrors. # # If the mirrorlist= does not work for you, as a fall back you can try the # remarked out baseurl= line instead. # # [base] name=CentOS-7 - Base - 163.com #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os baseurl=http://mirrors.163.com/centos/7/os/$basearch/ gpgcheck=1 gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7 #released updates [updates] name=CentOS-7 - Updates - 163.com #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates baseurl=http://mirrors.163.com/centos/7/updates/$basearch/ gpgcheck=1 gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7 #additional packages that may be useful [extras] name=CentOS-7 - Extras - 163.com #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras baseurl=http://mirrors.163.com/centos/7/extras/$basearch/ gpgcheck=1 gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7 #additional packages that extend functionality of existing packages [centosplus] name=CentOS-7 - Plus - 163.com baseurl=http://mirrors.163.com/centos/7/centosplus/$basearch/ gpgcheck=1 enabled=0 gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7 然后yum makecache生成缓存成功!!! 真的是。。

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:AKGN200蓝牙耳机评测 值不值得买
下一篇:深入理解Java8新特性之Stream API的终止操作步骤
相关文章

 发表评论

暂时没有评论,来抢沙发吧~