背景
在用yum安装的时候,可能会因为网络原因会找不到一些软件
更换yum源
我们可以通过更换yum源来改善这个情况,把yum源设置为国内的的源可以提升安装软件包或更新软件包的速度
步骤
常用源
我们常用的国内有下面几个源
网易:
CentOS 5: http://mirrors.163.com/.help/CentOS5-Base-163.repo
CentOS 6: http://mirrors.163.com/.help/CentOS6-Base-163.repo
CentOS 7: http://mirrors.163.com/.help/CentOS7-Base-163.repo
阿里
CentOS 5: http://mirrors.aliyun.com/repo/Centos-5.repo
CentOS 6: http://mirrors.aliyun.com/repo/Centos-6.repo
CentOS 7: http://mirrors.aliyun.com/repo/Centos-7.repo
备份原来的源
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
生成yum源cache
先进入目录cd /etc/yum.repos.d/
yum clean all
yum makecache
all done