yum 安装时错误 Errno 14 Couldn't resolve host 解决办法

在用yum安装docker 相关插件的时候发现一直报错,错误内容大致如下

Downloading packages:
No Presto metadata available for updates
device-mapper-1.02.158-2.el7_7 FAILED                                          
http://mirrors.nju.edu.cn/centos/7.7.1908/updates/x86_64/Packages/device-mapper-1.02.158-2.el7_7.2.x86_64.rpm: [Errno 14] curl#6 - "Could not resolve host: mirrors.nju.edu.cn; Unknown error"
正在尝试其它镜像。
device-mapper-libs-1.02.158-2. FAILED                                          
http://mirror.lzu.edu.cn/centos/7.7.1908/updates/x86_64/Packages/device-mapper-libs-1.02.158-2.el7_7.2.x86_64.rpm: [Errno 14] curl#6 - "Could not resolve host: mirror.lzu.edu.cn; Unknown error"
正在尝试其它镜像。
device-mapper-event-1.02.158-2 FAILED                                          
http://ap.stykers.moe/centos/7.7.1908/updates/x86_64/Packages/device-mapper-event-1.02.158-2.el7_7.2.x86_64.rpm: [Errno 14] curl#6 - "Could not resolve host: ap.stykers.moe; Unknown error"
正在尝试其它镜像。
device-mapper-event-libs-1.02. FAILED                                          
http://mirrors.163.com/centos/7.7.1908/updates/x86_64/Packages/device-mapper-event-libs-1.02.158-2.el7_7.2.x86_64.rpm: [Errno 14] curl#6 - "Could not resolve host: mirrors.163.com; Unknown error"
正在尝试其它镜像。
lvm2-2.02.185-2.el7_7.2.x86_64 FAILED                                          
http://ftp.sjtu.edu.cn/centos/7.7.1908/updates/x86_64/Packages/lvm2-2.02.185-2.el7_7.2.x86_64.rpm: [Errno 14] curl#6 - "Could not resolve host: ftp.sjtu.edu.cn; Unknown error"
正在尝试其它镜像。
lvm2-libs-2.02.185-2.el7_7.2.x FAILED                                          
http://centos.ustc.edu.cn/centos/7.7.1908/updates/x86_64/Packages/lvm2-libs-2.02.185-2.el7_7.2.x86_64.rpm: [Errno 14] curl#6 - "Could not resolve host: centos.ustc.edu.cn; Unknown error"
正在尝试其它镜像。
device-mapper-1.02.158-2.el7_7 FAILED                                          
http://mirrors.tuna.tsinghua.edu.cn/centos/7.7.1908/updates/x86_64/Packages/device-mapper-1.02.158-2.el7_7.2.x86_64.rpm: [Errno 14] curl#6 - "Could not resolve host: mirrors.tuna.tsinghua.edu.cn; Unknown error"
正在尝试其它镜像。
device-mapper-libs-1.02.158-2. FAILED                                          
http://mirrors.cqu.edu.cn/CentOS/7.7.1908/updates/x86_64/Packages/device-mapper-libs-1.02.158-2.el7_7.2.x86_64.rpm: [Errno 14] curl#6 - "Could not resolve host: mirrors.cqu.edu.cn; Unknown error"
正在尝试其它镜像。
device-mapper-event-1.02.158-2 FAILED                                          
http://mirrors.neusoft.edu.cn/centos/7.7.1908/updates/x86_64/Packages/device-mapper-event-1.02.158-2.el7_7.2.x86_64.rpm: [Errno 14] curl#6 - "Could not resolve host: mirrors.neusoft.edu.cn; Unknown error"
正在尝试其它镜像。
device-mapper-event-libs-1.02. FAILED                                          
http://mirrors.aliyun.com/centos/7.7.1908/updates/x86_64/Packages/device-mapper-event-libs-1.02.158-2.el7_7.2.x86_64.rpm: [Errno 14] curl#6 - "Could not resolve host: mirrors.aliyun.com; Unknown error"
正在尝试其它镜像。
device-mapper-event-1.02.158-2 FAILED                                          
http://mirrors.nju.edu.cn/centos/7.7.1908/updates/x86_64/Packages/device-mapper-event-1.02.158-2.el7_7.2.x86_64.rpm: [Errno 14] curl#6 - "Could not resolve host: mirrors.nju.edu.cn; Unknown error"
正在尝试其它镜像。
device-mapper-libs-1.02.158-2. FAILED                                          
http://mirrors.aliyun.com/centos/7.7.1908/updates/x86_64/Packages/device-mapper-libs-1.02.158-2.el7_7.2.x86_64.rpm: [Errno 14] curl#6 - "Could not resolve host: mirrors.aliyun.com; Unknown error"
正在尝试其它镜像。
lvm2-2.02.185-2.el7_7.2.x86_64 FAILED                                          
http://mirrors.tuna.tsinghua.edu.cn/centos/7.7.1908/updates/x86_64/Packages/lvm2-2.02.185-2.el7_7.2.x86_64.rpm: [Errno 14] curl#6 - "Could not resolve host: mirrors.tuna.tsinghua.edu.cn; Unknown error"

只粘了一部分

后来网上查了一下说是DNS服务器错误。于是修改一下 有限网络设置(ifcfg-eth0为我当前连接的有线网络配置文件)

vim /etc/sysconfig/network-scripts/ifcfg-eth0

添加DNS1=8.8.8.8 即可

重启网络service network restart 

问题完美解决

你可能感兴趣的:(yum命令异常情况,linux)