加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

使用yum安装服务报错:[Errno 14] curl#6 - "Could not reso

发布时间:2020-12-15 22:32:38 所属栏目:安全 来源:网络整理
导读:现象:使用yum命令安装软件,报以下错误: failure: repodata/repomd.xml from epel: [Errno 256] No more mirrors to try. http://mirrors.cloud.aliyuncs.com/epel/6/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.c

现象:使用yum命令安装软件,报以下错误:

failure: repodata/repomd.xml from epel: [Errno 256] No more mirrors to try.
http://mirrors.cloud.aliyuncs.com/epel/6/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.cloud.aliyuncs.com; Name or service not known"

原因:yum 源 mirrors.cloud.aliyuncs.com不存在。

解决办法:

1、首先进入 /etc/yum.repos.d 目录,备份CentOS-Base.repo源,

#cp CentOS-Base.repo? CentOS-Base.repo.bak??

2、修改?CentOS-Base.repo 文件

#vi? CentOS-Base.repo

将http://mirrors.cloud.aliyuncs.com? 批量替换为??http://mirrors.aliyun.com

3、备份epel.repo源,修改epel.repo文件

#cp? epel.repo??epel.repo.bak

#vi??epel.repo

http://mirrors.cloud.aliyuncs.com 批量替换为??http://mirrors.aliyun.com

4、清理yum缓存和重新生成缓存,

#yum? clean? all

#yum? makecache

之后继续yum就正常了。

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读