CentOS Linux第三方yum源

CentOS除了官方的软件源外,还有很多知名的第三方yum源,如前文说的RPMForge,官网上对第三方源也有说明:http://wiki.centos.org/AdditionalResources/Repositories/

安装一个EPEL源,EPEL(http://fedoraproject.org/wiki/EPEL) 是由 Fedora 社区打造,为 RHEL 及衍生发行版如 CentOS、Scientific Linux 等提供高质量软件包的项目。这里系统是CentOS5.7。

1、首先同样要安装yum-priorities插件,具体操作可参考上上一篇。

2、下载安装EPEL的rpm包
i386系统:

rpm -ivh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm

x86_64系统:

rpm -ivh http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm

PS:好像这两个软件包是一样的。

http://fedoraproject.org/wiki/EPEL/FAQ#howtouse

3、安装GPG Key

rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL

4、设置软件源优先级
添加顺序指令priority=N(N>10)。

vim /etc/yum.repos.d/epel.repo

[epel]、[epel-debuginfo]、[epel-source]最后分别设置priority=11。

5、验证是否设置成功
现在可以直接用yum安装nginx了。

yum install nginx

PS:CentOS6要装/epel/6目录下的软件包。http://download.fedora.redhat.com/pub/epel/6/

参考资料:
http://blog.csdn.net/serverside/article/details/5684970