Centos添加YUM源

默认的YUM源对于我们来说太慢了,因此我们一般用网易的源(163),下载速度可以达到700Kb/s,且更新速度快。

1.首先进入YUM源目录
$cd /etc/yum.repos.d
2.备份YUM源
$cp CentOS-Base.repo CentOS-Base.repo.bak
3.下载YUM源
//163的源
$wget http://mirrors.163.com/.help/CentOS-Base-163.repo
//sohu的源
$wget http://mirrors.sohu.com/help/CentOS-Base-sohu.repo
4.更新操作
$sudo yum makecache

建议为CentOS安装EPEL软件仓库,据说是最全的YUM源。
CentOS 6.x 32-bit
rpm -Uvh http://mirror.overthewire.com.au/pub/epel/6/i386/epel-release-6-7.noarch.rpm

CentOS 6.x 64-bit
rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-7.noarch.rpm

CentOS 5.x 32-bit
rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm

CentOS 5.x 64-bit
rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm

如果想要停用EPEL软件仓库
1.打开配置文件
$sudo vim /etc/yum.repos.d/epel.repo
2.在文件尾部添加配置项:enable=0
3.保存配置文件。

ORIGINAL:http://hongyuan1989.blog.51cto.com/2763144/1003927