yum报错 Couldn't resolve host 'mirrors.cloud.aliyuncs.com

  • 内容
  • 评论
  • 相关

错误:failure: repodata/repomd.xml from base: [Errno 256] No more mirrors to try.
http://mirrors.cloud.aliyuncs.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.cloud.aliyuncs.com; Unknown error"

 

1.首先进入 /etc/yum.repos.d 目录

cp CentOS-Base.repo CentOS-Base.repo.bak

2.修改 CentOS-Base.repo 文件

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

3.cp  epel.repo  epel.repo.bak

4.修改epel.repo文件

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

之后继续yum就正常了