Centos7中yum安装时出现错误[Errno 14] curl#6 - "Could not resolve host: mirrors.aliyuncs.com; Unknown e解决办法

我在yum源来下载httpd出现了以下的错误:


[root@master ~]# yum install httpd -y
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
正在解决依赖关系
--> 正在检查事务
---> 软件包 httpd.x86_64.0.2.4.6-90.el7.centos 将被 安装
--> 正在处理依赖关系 httpd-tools = 2.4.6-90.el7.centos,它被软件包 httpd-2.4.6-90.el7.centos.x86_64 需要
--> 正在处理依赖关系 /etc/mime.types,它被软件包 httpd-2.4.6-90.el7.centos.x86_64 需要
--> 正在检查事务
---> 软件包 httpd-tools.x86_64.0.2.4.6-90.el7.centos 将被 安装
---> 软件包 mailcap.noarch.0.2.1.41-2.el7 将被 安装
--> 解决依赖关系完成

依赖关系解决

=========================================================================================================
 Package                  架构                版本                               源                 大小
=========================================================================================================
正在安装:
 httpd                    x86_64              2.4.6-90.el7.centos                base              2.7 M
为依赖而安装:
 httpd-tools              x86_64              2.4.6-90.el7.centos                base               91 k
 mailcap                  noarch              2.1.41-2.el7                       base               31 k

事务概要
=========================================================================================================
安装  1 软件包 (+2 依赖软件包)

总计:2.8 M
总下载量:121 k
安装大小:9.6 M
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
(1/2): httpd-tools-2.4.6-90.el7.centos.x86_64.rpm                                 |  91 kB  00:00:00     
mailcap-2.1.41-2.el7.noarch.rp FAILED                                          
http://mirrors.aliyun.com/centos/7/os/x86_64/Packages/mailcap-2.1.41-2.el7.noarch.rpm: [Errno 14] curl#6 - "Could not resolve host: mirrors.aliyun.com; Unknown error"
正在尝试其它镜像。
mailcap-2.1.41-2.el7.noarch.rp FAILED                                          
http://mirrors.cloud.aliyuncs.com/centos/7/os/x86_64/Packages/mailcap-2.1.41-2.el7.noarch.rpm: [Errno 14] curl#6 - "Could not resolve host: mirrors.cloud.aliyuncs.com; Unknown error"
正在尝试其它镜像。
mailcap-2.1.41-2.el7.noarch.rp FAILED                                          
http://mirrors.aliyuncs.com/centos/7/os/x86_64/Packages/mailcap-2.1.41-2.el7.noarch.rpm: [Errno 14] curl#7 - "Failed connect to mirrors.aliyuncs.com:80; Connection refused"
正在尝试其它镜像。
mailcap-2.1.41-2.el7.noarch.rp FAILED                                          
http://mirrors.aliyuncs.com/centos/7/os/x86_64/Packages/mailcap-2.1.41-2.el7.noarch.rpm: [Errno 14] curl#7 - "Failed connect to mirrors.aliyuncs.com:80; Connection refused"
正在尝试其它镜像。
mailcap-2.1.41-2.el7.noarch.rp FAILED                                          
http://mirrors.aliyuncs.com/centos/7/os/x86_64/Packages/mailcap-2.1.41-2.el7.noarch.rpm: [Errno 14] curl#7 - "Failed connect to mirrors.aliyuncs.com:80; Connection refused"
正在尝试其它镜像。
mailcap-2.1.41-2.el7.noarch.rp FAILED                                          
http://mirrors.aliyuncs.com/centos/7/os/x86_64/Packages/mailcap-2.1.41-2.el7.noarch.rpm: [Errno 14] curl#6 - "Could not resolve host: mirrors.aliyuncs.com; Unknown error"
正在尝试其它镜像。


Error downloading packages:
  mailcap-2.1.41-2.el7.noarch: [Errno 256] No more mirrors to try.


主要错误是:

mailcap-2.1.41-2.el7.noarch.rp FAILED                                          
http://mirrors.aliyuncs.com/centos/7/os/x86_64/Packages/mailcap-2.1.41-2.el7.noarch.rpm: [Errno 14] curl#6 - "Could not resolve host: mirrors.aliyuncs.com; Unknown error"
正在尝试其它镜像


解决办法:

第一步:

[root@master ~]# vi /etc/resolv.conf 

第二步:

# Generated by NetworkManager
nameserver 8.8.8.8
#向resolv.conf文件中添加下面内容
nameserver 114.114.114.114

你可能感兴趣的:(Linux)