问题:
[root@host0 ~]# yum repolist
Loaded plugins: axelget, fastestmirror, langpacks, priorities, versionlock
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock error was
14: HTTP Error 502 - Bad Gateway
repo id repo name status
base/7/x86_64 CentOS-7 - Base 0
!epel/x86_64 Extra Packages for Enterprise Linux 7 - x86_64 0
extras/7/x86_64 CentOS-7 - Extras 0
updates/7/x86_64 CentOS-7 - Updates 0
repolist: 0
cd /etc/yum.repos.d/
一查,是Centos.Base 这个里面的repo ,网上找了一下,没有答案
把http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock 粘贴在浏览器中, 显示结果。
http://centos.ustc.edu.cn/centos/7.1.1503/os/x86_64/
http://ftp.sjtu.edu.cn/centos/7.1.1503/os/x86_64/
http://mirrors.yun-idc.com/centos/7.1.1503/os/x86_64/
http://mirrors.skyshe.cn/centos/7.1.1503/os/x86_64/
http://mirrors.nwsuaf.edu.cn/centos/7.1.1503/os/x86_64/
http://mirrors.hust.edu.cn/centos/7.1.1503/os/x86_64/
http://mirrors.btte.net/centos/7.1.1503/os/x86_64/
http://mirror.bit.edu.cn/centos/7.1.1503/os/x86_64/
http://mirrors.aliyun.com/centos/7.1.1503/os/x86_64/
http://mirrors.zju.edu.cn/centos/7.1.1503/os/x86_64/
[root@host0 ~]# curl http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock -o a.html
Test mode - must specify ip/cc, arch and repo as parameters
[root@host0 ~]# curl "http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock" -o a.html
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 528 0 528 0 0 784 0 --:--:-- --:--:-- --:--:-- 784
[root@host0 ~]#
[root@host0 ~]#
[root@host0 ~]# cat a.html
http://centos.ustc.edu.cn/centos/7.1.1503/os/x86_64/
http://ftp.sjtu.edu.cn/centos/7.1.1503/os/x86_64/
http://mirrors.yun-idc.com/centos/7.1.1503/os/x86_64/
http://mirrors.skyshe.cn/centos/7.1.1503/os/x86_64/
http://mirrors.nwsuaf.edu.cn/centos/7.1.1503/os/x86_64/
http://mirrors.hust.edu.cn/centos/7.1.1503/os/x86_64/
http://mirrors.btte.net/centos/7.1.1503/os/x86_64/
http://mirror.bit.edu.cn/centos/7.1.1503/os/x86_64/
http://mirrors.aliyun.com/centos/7.1.1503/os/x86_64/
http://mirrors.zju.edu.cn/centos/7.1.1503/os/x86_64/
这个是正常的结果。
想起在yum.conf中配置了proxy(为了访问一些被墙掉的repo) , 去掉, 再试,竟然好了, 之前一直都是好的啊, 不知道为什么,后续再查。