ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and tr

2022-05-31 11:04:03  阅读:182  来源: 互联网

标签:xml retrieve repository centos mirrors basearch aliyun http com


镜像下载、域名解析、时间同步请点击 阿里云开源镜像站

错误:Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again

通过yum -y install XXX 尝试安装软件,出现Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again的错误

问题原因:对应的镜像库中无法找到对应的repomd.xml文件

问题解决:原centos/6/ 下已经没有相关的文件,尝试修改本地镜像配置文件

步骤:

cd /etc/yum.repos.d
vim CentOS-Base.repo

因为$releasever 获取的是centos的版本号,我的centos获取的版本为6,但是镜像站中无对应版本文件,因此需要修改本地配置文件

:%s/$releasever/7/g #将文件中$releasever全部改成7或其他版本

或者替换参考的配置

gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7

#released updates 
[updates]
name=CentOS-7 - Updates - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/7/updates/$basearch/
        http://mirrors.aliyuncs.com/centos/7/updates/$basearch/
        http://mirrors.cloud.aliyuncs.com/centos/7/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7

#additional packages that may be useful
[extras]
name=CentOS-7 - Extras - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/7/extras/$basearch/
        http://mirrors.aliyuncs.com/centos/7/extras/$basearch/
        http://mirrors.cloud.aliyuncs.com/centos/7/extras/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-7 - Plus - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/7/centosplus/$basearch/
        http://mirrors.aliyuncs.com/centos/7/centosplus/$basearch/
        http://mirrors.cloud.aliyuncs.com/centos/7/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7

#contrib - packages by Centos Users
[contrib]
name=CentOS-7 - Contrib - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/7/contrib/$basearch/
        http://mirrors.aliyuncs.com/centos/7/contrib/$basearch/
        http://mirrors.cloud.aliyuncs.com/centos/7/contrib/$basearch/

退出保存

:wq

清除和重新生成缓存

yum clean all 
yum makecache 

完成之后再次通过yum -y install XXX 尝试安装软件

本文转自:https://blog.csdn.net/weixin_46220576/article/details/123230035

标签:xml,retrieve,repository,centos,mirrors,basearch,aliyun,http,com
来源: https://www.cnblogs.com/helong-123/p/16329638.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有