centos8:Could not resolve host: mirrorlist.centos.org
【1】错误消息:
[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】解决方法:
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;"之解决办法(换源)-腾讯云开发者社区-腾讯云