centosorg_Unknown_error_0">在执行yum指令出现源更新不了Could not resolve host: mirrorlist.centos.org; Unknown error问题
yum -y update
结果
Errors during downloading metadata for repository 'appstream':
- Curl error (6): Couldn't resolve host name for http://mirrorlist.centos.org/?release=8&arch=x86_64&repo=AppStream&infra=stock [Could not resolve host: mirrorlist.centos.org]
Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: Curl error (6): Couldn't resolve host name for http://mirrorlist.centos.org/?release=8&arch=x86_64&repo=AppStream&infra=stock [Could not resolve host: mirrorlist.centos.org]
问题排查:
1、先确认一下是否网络问题,执行指令
ping www.baidu.com
网络没有问题的结果
如果有问题就解决一下网络问题
2、yum的源问题,由于官方不更新的原因导致使用不了
先到/etc/yum.repos.d目录,把有问题的东西删除
再从阿里云仓库找到相应
http://mirrors.aliyun.com/repo
直接可以下载
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-8.repo
再更新yum
yum clean all
yum makecache
yum -y update
就解决问题了,祝你好运。。。