centos8:Could not resolve host: mirrorlist.centos.org


【1】错误消息:

cpp 复制代码
[root@centos211 redis-7.0.15]# yum update                    
CentOS Stream 8 - AppStream                                                                                                                                                      0.0  B/s |   0  B     00:00    
Errors during downloading metadata for repository 'appstream':
  - Curl error (6): Couldn't resolve host name for http://mirrorlist.centos.org/?release=8-stream&arch=x86_64&repo=AppStream&infra=stock [Could not resolve host: mirrorlist.centos.org]
错误:为 repo 'appstream' 下载元数据失败 : Cannot prepare internal mirrorlist: Curl error (6): Couldn't resolve host name for http://mirrorlist.centos.org/?release=8-stream&arch=x86_64&repo=AppStream&infra=stock [Could not resolve host: mirrorlist.centos.org]

【2】解决方法:

cpp 复制代码
sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/CentOS-*.repo
sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/CentOS-*.repo
sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/CentOS-*.repo
yum clean all
yum makecache

【3】 参考资料

https://support.tuxcare.com/hc/en-us/articles/14841452161820-Could-not-resolve-host-mirrorlist-centos-org

CentOS7 yum安装报错"Could not resolve host: mirrorlist.centos.org;"之解决办法(换源)-腾讯云开发者社区-腾讯云

相关推荐
lzh200409197 分钟前
Linux管道(Pipe)深度指南:从原理到实战
linux·c++
liann1199 分钟前
3.4_Linux 应急响应排查速查命令表
linux·运维·服务器·安全·网络安全·系统安全
孪生质数-10 分钟前
Linux高危漏洞通报Copy Fail - CVE-2026-31431
linux·运维·服务器·ubuntu·网络安全·debian·cve-2026-31431
IMPYLH15 分钟前
Linux 的 tee 命令
linux·运维·服务器·bash
lzh2004091915 分钟前
Linux信号(Signal)
linux·c++
pc079326 分钟前
带网络接口的打印机和USB接口打印机的共享区别
运维·服务器·网络
理人综艺好会41 分钟前
nginx了解
运维·nginx
雷工笔记1 小时前
KingFusion|最近开发调试中遇到的几个问题及解决办法(2)
运维·服务器
蓝天居士1 小时前
Linux网络驱动之Fixed-Link(29)
linux·运维·网络
帅气的钟先生1 小时前
OpenClaw + QQBot 实战:从 0 到 1 搭建你的消息自动化助手
运维·人工智能·自动化