鏡像下載、功能變數名稱解析、時間同步請點擊 阿裡雲開源鏡像站 錯誤:Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again 通過yum -y ins ...
鏡像下載、功能變數名稱解析、時間同步請點擊 阿裡雲開源鏡像站
錯誤: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