当前位置: 首页 > news >正文

Cannot find a valid baseurl for repo: base/7/x86_64

默认仓库连接地址,网络不通导致,更换仓库地址

已加载插件:fastestmirror
Determining fastest mirrors
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; 未知的错误"One of the configured repositories failed (未知),and yum doesn't have enough cached data to continue. At this point the onlysafe thing yum can do is fail. There are a few ways to work "fix" this:1. Contact the upstream for the repository and get them to fix the problem.2. Reconfigure the baseurl/etc. for the repository, to point to a workingupstream. This is most often useful if you are using a newerdistribution release than is supported by the repository (and thepackages for the previous distribution release still work).3. Run the command with the repository temporarily disabledyum --disablerepo=<repoid> ...4. Disable the repository permanently, so yum won't use it by default. Yumwill then just ignore the repository until you permanently enable itagain or use --enablerepo for temporary usage:yum-config-manager --disable <repoid>orsubscription-manager repos --disable=<repoid>5. Configure the failing repository to be skipped, if it is unavailable.Note that yum will try to contact the repo. when it runs most commands,so will have to try and fail each time (and thus. yum will be be muchslower). If it is a very temporary problem though, this is often a nicecompromise:yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=trueCannot find a valid baseurl for repo: base/7/x86_64

ping对应的网站网络不通,ping百度是通的。证明不是本机网络问题,只能更换镜像仓库地址。

  1. 创建备份目录:mkdir /etc/yum.repos.d/bak
  2. 现有仓库地址移动到备份目录: mv /etc/yum.repos.d/CentOS-* /etc/yum.repos.d/bak/
  3. 创建新的仓库地址文件:vi /etc/yum.repos.d/CentOS-Base.repo

CentOS-Base.repo文件内容:

[base]
name=CentOS-$releasever - Base - mirrors.aliyun.com failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/7/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
[updates]
name=CentOS-$releasever - Updates - mirrors.aliyun.com failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/7/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
[extras]
name=CentOS-$releasever - Extras - mirrors.aliyun.com failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/7/extras/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
[centosplus]
name=CentOS-$releasever - Plus - mirrors.aliyun.com failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/7/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7

4. yum clean all

5. yum makecache

问题解决,可以执行yum命令在线安装了,会使用阿里云的镜像地址。

    http://www.dtcms.com/a/394589.html

    相关文章:

  1. Lowpoly建模练习集
  2. 六、kubernetes 1.29 之 Pod 控制器02
  3. OpenCV:人脸检测,Haar 级联分类器原理
  4. 类和对象 (上)
  5. FreeRTOS 队列集(Queue Set)机制详解
  6. 【论文速递】2025年第20周(May-11-17)(Robotics/Embodied AI/LLM)
  7. 【秋招笔试】2025.09.21网易秋招笔试真题
  8. C++ 之 【特殊类设计 与 类型转换】
  9. 第14章 MySQL索引
  10. Entities - 遍历与查询
  11. TargetGroup 全面优化:从六个维度打造卓越用户体验
  12. Proxy与Reflect
  13. 浅解Letterbox算法
  14. 【Triton 教程】triton_language.permute
  15. JavaScript洗牌算法实践
  16. 掌握timedatectl命令:Ubuntu 系统时间管理指南
  17. 【RT Thread】RTT内核对象机制详解
  18. Seata分布式事务
  19. 用例图讲解
  20. makefile原理
  21. AUTOSAR CP开发流程总结
  22. 通过VNC实现树莓派远程桌面访问
  23. linux信号done
  24. BeanUtils.copyProperties 映射规则详解
  25. 物联网 frid卡控制
  26. LeetCode刷题记录----322.零钱兑换(Medium)
  27. 2015/07 JLPT听力原文 问题四
  28. Redis集群实验
  29. 昇腾生态双支柱:MindSpore 与 CANN 的全栈技术解析
  30. YOLO系列——实时屏幕检测