CentOS中文网

解决CentOS7 运行.sh脚本文件提示mirrors访问失败(Errno12)

CentOS中文网 https://www.centos.net.cn 2016-06-24 01:35 出处:网络 编辑:#iCMS
今天安装LTMP安装脚本,提示 timeoutonhttp://mirrors.aliyuncs.com/centos/7/addons/x86_64/repodata/repomd.xml:[12]Timeoutonhttp://http://mirrors.aliyuncs.com/centos/7/addons/x86_64/repodata/repomd.xml(28

今天安装LTMP安装脚本,提示

timeout on http://mirrors.aliyuncs.com/centos/7/addons/x86_64/repodata/repomd.xml:[12]Timeout on http://http://mirrors.aliyuncs.com/centos/7/addons/x86_64/repodata/repomd.xml(28,'Connection timed out after 30001 milliseconds')

解决CentOS7 运行.sh脚本文件提示mirrors访问失败(Errno12)


用浏览器打开http://mirrors.aliyuncs.com/centos/7/addons/x86_64/repodata/repomd.xml,显示404;但访问http://mirrors.aliyuncs.com/倒是正常!


再往下级访问,终于发现问题所在:http://mirrors.aliyuncs.com/centos/7/OS/x86_64/repodata/repomd.xml


解决方法:2选1


1、修改Centos-Base.repo

[root~]#vi /etc/yum.repos.d/CentOS-Base.repo


baseurl=http://mirrors.aliyun.com/centos/$releasever/addons/$basearch/


http://mirrors.aliyuncs.com/centos/$releasever/addons/$basearch/


更改为:


baseurl=http://mirrors.aliyun.com/centos/$releasever/os/$basearch/


http://mirrors.aliyuncs.com/centos/$releasever/os/$basearch/


2、替换Centos-Base.repo


[root~]#cd/etc/yum.repos.d


[root~]#mv ./CentOS-Base.repo ./CentOS-Base.repo.bak


[root~]#wget http://mirrors.163.com/.help/CentOS7-Base-163.repo


[root~]#mv CentOS6-Base-163.repo CentOS-Base.repo


[root~]#yum makecache

CentOS 源状态查询地址

http://mirror-status.centos.org/#cn

0

精彩评论

暂无评论...
验证码 换一张
取 消