ASCII码 ASCII码

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

发布于:2022-06-01 15:09:54  栏目:技术文档

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

错误: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/ 下已经没有相关的文件,尝试修改本地镜像配置文件

步骤:

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

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

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

或者替换参考的配置

  1. gpgcheck=1
  2. gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
  3. #released updates
  4. [updates]
  5. name=CentOS-7 - Updates - mirrors.aliyun.com
  6. failovermethod=priority
  7. baseurl=http://mirrors.aliyun.com/centos/7/updates/$basearch/
  8. http://mirrors.aliyuncs.com/centos/7/updates/$basearch/
  9. http://mirrors.cloud.aliyuncs.com/centos/7/updates/$basearch/
  10. gpgcheck=1
  11. gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
  12. #additional packages that may be useful
  13. [extras]
  14. name=CentOS-7 - Extras - mirrors.aliyun.com
  15. failovermethod=priority
  16. baseurl=http://mirrors.aliyun.com/centos/7/extras/$basearch/
  17. http://mirrors.aliyuncs.com/centos/7/extras/$basearch/
  18. http://mirrors.cloud.aliyuncs.com/centos/7/extras/$basearch/
  19. gpgcheck=1
  20. gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
  21. #additional packages that extend functionality of existing packages
  22. [centosplus]
  23. name=CentOS-7 - Plus - mirrors.aliyun.com
  24. failovermethod=priority
  25. baseurl=http://mirrors.aliyun.com/centos/7/centosplus/$basearch/
  26. http://mirrors.aliyuncs.com/centos/7/centosplus/$basearch/
  27. http://mirrors.cloud.aliyuncs.com/centos/7/centosplus/$basearch/
  28. gpgcheck=1
  29. enabled=0
  30. gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
  31. #contrib - packages by Centos Users
  32. [contrib]
  33. name=CentOS-7 - Contrib - mirrors.aliyun.com
  34. failovermethod=priority
  35. baseurl=http://mirrors.aliyun.com/centos/7/contrib/$basearch/
  36. http://mirrors.aliyuncs.com/centos/7/contrib/$basearch/
  37. http://mirrors.cloud.aliyuncs.com/centos/7/contrib/$basearch/

退出保存

  1. :wq

清除和重新生成缓存

  1. yum clean all
  2. yum makecache

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

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

相关推荐
阅读 +