当前位置: > CentOS > CentOS故障 >

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

时间:2016-06-24 01:48来源:linux.it.net.cn 作者:IT

 今天安装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')



   用浏览器打开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



(责任编辑:IT)
------分隔线----------------------------
栏目列表
推荐内容