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

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

相关文章:

  • 政策支持与市场驱动:充电桩可持续发展的双轮引擎
  • cmake qt 项目编译
  • 亚马逊环保标识运营指南:抢占流量新赛道的6大策略解析
  • 对话式 BI:让数据洞察从“专业门槛”变为“对话本能”
  • 【Keil5-开发指南】
  • 使用Docker安装Harbor
  • 机器学习day2
  • 防火墙拦截DNS请求-原理解析
  • 核心要点:线程
  • 机器学习-08-时序数据分析预测
  • IEEE会议:第十届网络安全与信息工程国际会议(ICCSIE 2025)
  • Java后端开发day38--不可变集合Stream流
  • 2799. 统计完全子数组的数目
  • 硅基计划 学习总结 拾
  • 在 cmd shell 中执行 metasploit vbs payload
  • SpringBoot自动配置
  • 【UserDetailsService】
  • [Windows] MousePlus 5.5.9
  • 软考-软件设计师中级备考 4、数据结构
  • 关于 【Spring Boot Configuration Annotation Processor 未配置问题】 的详细分析、解决方案及代码示例
  • 五月院线片单:就看五一档表现了
  • 五一假期上海推出首批16条“市民健康路线”,这些健康提示请收好
  • 西班牙遭遇史上最严重停电,已进入国家紧急状态
  • 马上评丨学生举报食堂饭菜有蛆,教育局应该护谁的犊子
  • 格力电器去年净利增长一成:消费电器营收下滑4%,一季度净利增长26%
  • 商务部:将积极会同相关部门加快推进离境退税政策落实落地