yum解决 "Couldn't resolve host 'apt.sw.be'" 错误

1.yum无法安装工具
    failure: repodata/repomd.xml from dag: [Errno 256] No more mirrors to try.
http://apt.sw.be/redhat/el7/en/x86_64/dag/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: apt.sw.be; Unknown error"
说明yum 源太老---解决办法:
最好的办法,换成国内的源
-bash-4.2$ ls
bak               CentOS-Debuginfo.repo  CentOS-Sources.repo  zabbix.repo
CentOS-Base.repo  CentOS-fasttrack.repo  CentOS-Vault.repo
CentOS-CR.repo    CentOS-Media.repo      dag.repo
首先备份
-bash-4.2$ mv * bak
下载阿里的源
-bash-4.2$ sudo wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
-bash-4.2$ ls
bak  CentOS-Base.repo
清除缓存 并更新
-bash-4.2$ sudo yum makecache
现在就可以装工具了
-bash-4.2$ sudo yum install tree -y

猜你喜欢

转载自www.cnblogs.com/dbslinux/p/10571080.html
今日推荐