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

yum install 失败

Could not resolve host: mirrorlist.centos.org Centos 7

yum install 时报错

[root@localhost ~]# yum update
Loaded plugins: fastestmirror
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; Unknown error"
http://mirror.centos.org/centos/7/os/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirror.centos.org; Unknown error"
Trying other mirror.One of the configured repositories failed (CentOS-7 - Base),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=base ...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 baseorsubscription-manager repos --disable=base5. 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=base.skip_if_unavailable=truefailure: repodata/repomd.xml from base: [Errno 256] No more mirrors to try.
http://mirror.centos.org/centos/7/os/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirror.centos.org; Unknown error"
[root@localhost ~]# 

从 2024 年 7 月 1 日起,在 CentOS 7 上,请切换到 Vault 存档存储库:
vi /etc/yum.repos.d/CentOS-Base.repo 替换成以下内容

[base]
name=CentOS-$releasever - Base
baseurl=http://vault.centos.org/7.9.2009/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7[updates]
name=CentOS-$releasever - Updates
baseurl=http://vault.centos.org/7.9.2009/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7[extras]
name=CentOS-$releasever - Extras
baseurl=http://vault.centos.org/7.9.2009/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7[centosplus]
name=CentOS-$releasever - Plus
baseurl=http://vault.centos.org/7.9.2009/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
http://www.xdnf.cn/news/2859.html

相关文章:

  • JavaScript高级进阶(四)
  • Easy系列PLC高速计数器比较指令
  • 乐理学习笔记(一)---节拍与音符
  • FTTR与普通家庭网络
  • tree命令
  • terraform local-exec与remote-exec详解
  • 爱芯元智/芯昇,XS9950A,1 通道AHD模拟视频
  • 记录一下QA(from deepseek)
  • WHAT - 《成为技术领导者》思考题(第三章)
  • 大数据应用开发和项目实战-Matplotlib
  • pyautogui基础操作
  • 学成在线。。。
  • USB3.0 、 PCIE、RFSoC、NVMe 新课程课程直播发布公告
  • 【技术笔记】通过Cadence Allegro创建一个PCB封装(以SOT23为例)
  • 4月28日星期一今日早报简报微语报早读
  • TF_LOG 配置及级别详解
  • Vue3 + Element-Plus + 阿里云文件上传
  • AD16制作3D封装元件
  • BZOJ.疯狂的馒头
  • uniswap getTickAtSqrtPrice 方法解析
  • 相机-IMU联合标定:IMU标定
  • 代码随想录算法训练营第六十一天 | floyd算法
  • 夜莺监控V8(Nightingale)二进制部署教程(保姆级)
  • Virtualbox虚拟机全屏后黑屏问题解决
  • Linux用户管理命令:su与useradd
  • 常用网址合集
  • 如何利用表格解决 Python 嵌套循环难题
  • SDK游戏盾、高防IP、高防CDN三者的区别与选型指南
  • 海外独立站VUE3加载优化
  • 第二届材料工程与智能制造国际学术会议