博主信息
博文 291
粉丝 0
评论 0
访问量 458214
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path
原创
1009人浏览过

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

错误: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

本博文版权归博主所有,转载请注明地址!如有侵权、违法,请联系admin@php.cn举报处理!
全部评论 文明上网理性发言,请遵守新闻评论服务协议
0条评论
作者最新博文
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号

  • 登录PHP中文网,和优秀的人一起学习!
    全站2000+教程免费学