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

  • 2
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值