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

安装最小化的CentOS7后,执行yum命令报错Could not resolve host mirrorlist.centos.org; 未知的错误

文章目录

  • 安装最小化的CentOS7后,执行yum命令报错"Could not resolve host: mirrorlist.centos.org; 未知的错误"
    • 错误
    • 解决方案:

安装最小化的CentOS7后,执行yum命令报错"Could not resolve host: mirrorlist.centos.org; 未知的错误"

错误

[root@anonymous yum.repos.d]# yum list lrzsz
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
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通114.114.114.114)

1.更新base.repo源

1.11备份文件

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

1.12下载新的CentOS-Base.repo 到/etc/yum.repos.d/

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

1.13运行yum makecache生成缓存

http://www.lryc.cn/news/529014.html

相关文章:

  • 图论——spfa判负环
  • 软件工程概论试题三
  • 21.3-启动流程、编码风格(了解) 第21章-FreeRTOS项目实战--基础知识之新建任务、启动流程、编码风格、系统配置 文件组成和编码风格(了解)
  • 未来无线技术的发展方向
  • Qt5离线安装包无法下载问题解决办法
  • qt-C++笔记之QLine、QRect、QPainterPath、和自定义QGraphicsPathItem、QGraphicsRectItem的区别
  • doris:导入时实现数据转换
  • 新版231普通阿里滑块 自动化和逆向实现 分析
  • 如何构建树状的思维棱镜认知框架
  • openRv1126 AI算法部署实战之——ONNX模型部署实战
  • Vue 组件开发:构建高效可复用的前端界面要素
  • Vue.js组件开发-实现全屏平滑移动、自适应图片全屏滑动切换
  • 水果实体店品牌数字化:RWA + 智能体落地方案
  • DeepSeek模型:开启人工智能的新篇章
  • Kubernetes 环境中的自动化运维实战指南
  • 深入解析 C++17 中的 std::not_fn
  • unity实现回旋镖函数
  • 想品客老师的第九天:原型和继承
  • 力扣【416. 分割等和子集】详细Java题解(背包问题)
  • 2025年AI手机集中上市,三星Galaxy S25系列上市
  • 为AI聊天工具添加一个知识系统 之79 详细设计之20 正则表达式 之7
  • 理解PLT表和GOT表
  • 6 年没回老家过年了
  • 【原创改进】SCI级改进算法,一种多策略改进Alpha进化算法(IAE)
  • 如何把一个python文件打包成一步一步安装的可执行程序
  • 防火墙安全策略部署
  • c++ map/multimap容器 学习笔记
  • 【解决方案】MuMu模拟器移植系统进度条卡住98%无法打开
  • 日志收集Day007
  • 虚拟机里网络设置-桥接与NAT