yum 安装软件的时候提示:error was 14: PYCURL ERROR 7 !!

root @localhost src]# yum -y install gcc gcc-c++ make glibc glibc-devel glib2 glib2-devel patch autoconf automake
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=extras error was
14: PYCURL ERROR 7 - "Failed to connect to 2a01:c0:2:4:216:3eff:fe0d:266d: 网络不可达"
Error: Cannot find a valid baseurl for repo: extras

在网上找了三个解决方法,第三方法可行! 
1:正确设置ip地址和dns  保证可以平通外网...
修改ip地址: /vi /etc/sysconfig/network-scripts/ifcfg-eth0
--------------------------------------------
BOOTPROTO="static"    
ONBOOT="yes"
IPADDR=192.168.1.111 
  NETMASK=192.168.255.0
GATEWAY=192.168.1.1 
------------------------------------------------

添加DNS: vi /etc/resolv.conf
---------------------------------------------
ameserver 8.8.8.8
---------------------------------------------

2.禁用ipv6地址  (方法很多自己找)
vi  /etc/sysconfig/network
NETWORKING=yes

IPV6INIT=no


3. 更改 repo源.     
/etc/yum.repos.d (自己替换里面的.repo结尾的文件)

我是在虚拟机里出现的这种错误! 我直接删除了 /etc/yum.repos.d 目录下的三个.repo结尾的文件.用正在使用的服务器上的三个.repo文件替换最后可以了....(虚拟机iso文件还是有问题啊!! )

你可能感兴趣的:(yum 安装软件的时候提示:error was 14: PYCURL ERROR 7 !!)