CentOS自带的yum源中rpm包数量有限,很多时候找不到我们需的软件包,所以我们需要安装包含丰富的第三方YUM源来满足我们的需求。
1、安装yum-priorities插件
[root@localhost ~]# yum install -y yum-priorities
yum-priorities插件的作用主要是设置调用源时的优先级的,一般将官方的优先级设置为最高
,在每个库最后加上priority=[]字段来设置每个镜像的优先级,1为最高,99为最低。
2、CentOS默认源设置(一般设置CentOS-Base,设置为优先级最高1)
[root@localhost ~]# vi /etc/yum.repos.d/CentOS-Base.repo
3、安装epel
32位:rpm -ivh http://mirrors.ustc.edu.cn/fedora/epel/6/i386/epel-release-6-8.noarch.rpm
64位:rpm -ivh http://mirrors.ustc.edu.cn/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm
[root@localhost ~]# rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
[root@localhost ~]# vi /etc/yum.repos.d/epel.repo #在每个库后面添加优先级2
4、安装rpmforge
32位:rpm -ivh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm
64位:rpm -ivh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
[root@localhost ~]# vi /etc/yum.repos.d/rpmforge.repo
5、安装rpmfusion
32位:rpm -ivh http://download1.rpmfusion.org/free/el/updates/6/i386/rpmfusion-free-release-6-1.noarch.rpm
64位:rpm -ivh http://download1.rpmfusion.org/free/el/updates/6/x86_64/rpmfusion-free-release-6-1.noarch.rpm
[root@localhost ~]# vi /etc/yum.repos.d/rpmfusion-free-updates.repo
[root@localhost ~]# vi /etc/yum.repos.d/rpmfusion-free-updates-testing.repo
6、加载所有YUM源
[root@localhost ~]# yum list #列出所有第三方YUM源的软件包