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

Could not resolve host: mirrorlist.centos.org; 未知的错误

原因是mirrorlist.centos停止镜像供应了,所以说我们需要更换镜像
1、找到配置文件

/etc/yum.repos.d/

使用vi 打开第一个文件CentOS-Base.repo
将里面的镜像替换成阿里云的镜像

# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the 
# remarked out baseurl= line instead.
#
#[base]
name=CentOS-$releasever - Base - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/os/$basearch/http://mirrors.aliyuncs.com/centos/$releasever/os/$basearch/http://mirrors.cloud.aliyuncs.com/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7#released updates 
[updates]
name=CentOS-$releasever - Updates - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/updates/$basearch/http://mirrors.aliyuncs.com/centos/$releasever/updates/$basearch/http://mirrors.cloud.aliyuncs.com/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/extras/$basearch/http://mirrors.aliyuncs.com/centos/$releasever/extras/$basearch/http://mirrors.cloud.aliyuncs.com/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/centosplus/$basearch/http://mirrors.aliyuncs.com/centos/$releasever/centosplus/$basearch/http://mirrors.cloud.aliyuncs.com/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/contrib/$basearch/http://mirrors.aliyuncs.com/centos/$releasever/contrib/$basearch/http://mirrors.cloud.aliyuncs.com/centos/$releasever/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7

若是不是用的centos 7 可以去官方网站下载对应的镜像
https://mirrors.aliyun.com/repo/

刷新一下yum重新加载

yum clean all
yum makecache

http://www.mrgr.cn/news/8735.html

相关文章:

  • 游戏开发设计模式之迭代器模式
  • npm install 报错解决记录
  • Linux静态ip/动态ip配置/bond链路聚合
  • java 使用ZooKeeper实现分布式锁
  • 【学术会议征稿】第二届物联网与云计算技术国际学术会议 (IoTCCT 2024)
  • 05:极限-无穷小
  • spring揭秘10-aop04-基于AspectJ类库注解织入横切逻辑
  • Java实现xml和json互转
  • colmap的几种相机类型和内外参取得方法
  • k8s Unable to fetch container log stats failed to get fsstats for
  • linux之ELK
  • .NET_WebForm_layui控件使用及与webform联合使用
  • 数据分析及应用:如何分析区间上用户分布情况 | 基于快递单量区间划分的用户分布情况 | 基于TOPN商品区间划分用户浏览情况分析
  • LRU缓存
  • http的keepalive和tcp的keepalive
  • Spring面试题二
  • 【数据结构3】哈希表、哈希表的应用(集合与字典、md5算法和文件的哈希值)
  • 图像分割论文阅读:BCU-Net: Bridging ConvNeXt and U-Net for medical image segmentation
  • 用excel内容批量建立文件夹
  • 全面解析轮换IP:原理、优势与应用详解