yum安装网络超时,尝试其他镜像
yum 报错:centos yum (28, ‘Connection time-out’) Trying other mirror.
目录
管道地址:https://www.cnblogs.com/wenyule/articles/9692473.html
前言:
在使用yum安装 软件时,经常出现 centos yum (28, ‘Connection time-out’) Trying other mirror. 或下面的那样情况imeout on http://mirrors.aliyun.com/centos/6/os/x86_64/repodata/repomd.xml: (28, ‘Connection time-out’) Trying other mirror.
当你用ping 网络时发现又是通的,浏览器访问链接也是通的。这就奇怪了,为什么yum一安装就说超时报错。换了阿里,网易好几个源都是一个问题,注意了,这可能不是repo源的问题,而是你DNS解析设置的问题。
我们知道网卡的DNS设置是首先生效的 /etc/sysconfig/network-scripts/ifcfg-eth0 然后才是全局的DNS配置文件 /etc/resolv.conf
可能你都都习惯这样设置(直接配置外网的DNS),这样设置在你的外网服务器VPS等环境是没有问题的,可当在内网环境如:虚拟机,本地,时就会造成了我们yum安装超时报错。这里最好设置成你内网的网关,如虚拟机配置的网关10.0.0.2。
内网环境DNS设置为网关地址,网关出去会自己找本地的DNS服务器去解析,当你在你的虚拟机设置成外网的DNS,网络好时没事,一不稳定,超时就会导致你安装软件失败。
因为虚拟机内直接填外网DNS,ping通没问题,可虚拟机网关在转发请求时,就容易掉。
建议虚拟机环境内网,设置DNS为网关地址
搞清楚自己的DNS设置后在设置repo源的问题。
反回顶部
错误详情
在centOs上安装软件时。提示超时,或链接不上的信息:
http://mirrors.aliyun.com/centos/6/os/x86_64/repodata/repomd.xml: [Errno 12] Timeout on http://mirrors.aliyun.com/centos/6/os/x86_64/repodata/repomd.xml: (28, ‘Connection time-out’)
Trying other mirror.
http://mirrors.aliyuncs.com/centos/6/os/x86_64/repodata/repomd.xml: [Errno 12] Timeout on http://mirrors.aliyuncs.com/centos/6/os/x86_64/repodata/repomd.xml: (28, ‘Connection time-out’)
Trying other mirror.
http://mirrors.cloud.aliyuncs.com/centos/6/os/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 6 - “Couldn’t resolve host ‘mirrors.cloud.aliyuncs.com’”
Trying other mirror.
http://mirrors.aliyun.com/epel/6/x86_64/repodata/repomd.xml: [Errno 12] Timeout on http://mirrors.aliyun.com/epel/6/x86_64/repodata/repomd.xml: (28, ‘Connection time-out’)
Trying other mirror.
注意上面提到的,自己的DNS!!! 然后再换源,不然换完还是超时报错,会很崩溃
反回顶部
CentOS换国内阿里云yum源
1、备份
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
2、下载新的CentOS-Base.repo 到/etc/yum.repos.d/
复制代码
CentOS 5
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo
或者
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo
CentOS 6
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
或者
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
CentOS 7
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
或者
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
复制代码
3、之后运行yum makecache生成缓存
[root@web02 ~]# yum clean all && yum makecache
- linux使用iso镜像用作yum安装源
- Redhat 7.0安装CentOS 7 的Yum 网络源
- 解决npm安装Electron缓慢网络超时导致失败的问题
- 网络yum的安装
- centos不联网情况下,使用系统镜像作为本地源yum安装软件
- 在RHEL 5.2中将yum的安装服务器指定到光盘镜像
- yum镜像安装kvm
- 有的时候用yum 在线安装linux软件包的时候 ,会提示找不到镜像的地址
- 给没有连接因特网的centos使用yum安装其他软件。
- Centos7直接安装mysql(空机器,没有其他的什么下载好的资源解压等操作,直接网络通过网络下载)
- redhat 7的 yum 安装,使用的centos镜像
- HTTP网络启动安装原版系统ISO镜像
- Linux下通过yum来安装 mysql 5.1,以及以前的旧版本(因服务器网络问题,安装后无法连接,无法验证正确性)
- Centos7 最小化安装需要静态配置IP,yum镜像和设置
- CentOS7安装后连不上网络无法使用yum
- python2.7安装 利用pip安装其他镜像配置(解决 Trusted--Host 问题)
- yum安装软件连接镜像服务器超时问题解决
- Vmware上Centos5.5 安装本地镜像yum
- Linux 安装网络yum地址
- centos7下面yum安装软件报错,显示找不到镜像地址