Centos8 Could not resolve host: mirrors.cloud.aliyuncs.com
当centos8出现一下问题时:
原因如下:
2021年12月31日CentOS 8 EOL。按照社区规则,CentOS 8的源地址http://mirror.centos.org/centos/8/
内容已移除,目前第三方的镜像站中均已移除CentOS 8的源。阿里云的源http://mirrors.cloud.aliyuncs.com和http://mirrors.aliyun.com
也无法同步到CentOS 8的源
原文链接:
CentOS 8 EOL如何切换源? - 云服务器 ECS - 阿里云https://help.aliyun.com/document_detail/405635.html?spm=5176.smartservice_service_chat.0.0.712c3f1bBoZ19I
运行一下命令:
一:
wget https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo -O /etc/yum.repos.d/Centos-vault-8.5.2111.repo
wget https://mirrors.aliyun.com/repo/epel-archive-8.repo -O /etc/yum.repos.d/epel-archive-8.repo
二:
sed -i 's/mirrors.cloud.aliyuncs.com/url_tmp/g' /etc/yum.repos.d/Centos-vault-8.5.2111.repo && sed -i 's/mirrors.aliyun.com/mirrors.cloud.aliyuncs.com/g' /etc/yum.repos.d/Centos-vault-8.5.2111.repo && sed -i 's/url_tmp/mirrors.aliyun.com/g' /etc/yum.repos.d/Centos-vault-8.5.2111.repo sed -i 's/mirrors.aliyun.com/mirrors.cloud.aliyuncs.com/g' /etc/yum.repos.d/epel-archive-8.repo
三:
执行 yum clean all && yum makecache
如果没有wget命令,下载这个repo文件,然后将/etc/yum.repos.d/CentOS-Base.repo 备份,移走,将最新的放上去
执行 yum clean all && yum makecache
https://download.csdn.net/download/liudongyang123/81887541https://download.csdn.net/download/liudongyang123/81887541