1、安装CentOS yum源优先级插件yum-priorities来设置YUM优先级
yum install yum-plugin-priorities.noarch
2、设置CentOS默认yum源的优先级为最高
cd /etc/yum.repos.d/
vi CentOS-Base.repo
#在[base]、[updates]、[extras]组下面添加priority=1,在[centosplus]、[contrib]组下面添加priority=2
备注:priority的优先级为1到99,设置为1即优先级最高,1-10为系统保留,第三方yum源的优先级从11-99
3、安装epel yum源
rpm -ivh http://mirrors.ustc.edu.cn/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
vi /etc/yum.repos.d/epel.repo #修改epel yum源优先级,priority=11
4、安装rpmforge yum源
rpm -ivh http://repository.it4i.cz/mirrors/repoforge/redhat/el6/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
vi /etc/yum.repos.d/rpmforge.repo #修改rpmforge yum源优先级,priority=12
5、安装rpmfusion yum源
rpm -ivh http://download1.rpmfusion.org/free/el/updates/testing/6/i386/rpmfusion-free-release-6-0.1.noarch.rpm
vi /etc/yum.repos.d/rpmfusion-free-updates-testing.repo #修改rpmfusion yum源优先级,priority=13
6、安装atomic yum源
wget http://www.atomicorp.com/installers/atomic #下载
sh ./atomic #安装
vi /etc/yum.repos.d/atomic.repo #修改atomic yum源优先级,priority=14
7、更新YUM软件包
yum check-update
8、centOS第三方YUM源大全
1)remi源
http://rpms.famillecollet.com
2)epel源
http://mirrors.ustc.edu.cn/epel
3)rpmforge源
http://repoforge.org/use
4)rpmfusion源
http://mirrors.163.com/rpmfusion
5)centalt源
http://centos.alt.ru/repository
6)Percona源
http://www.percona.com/downloads/percona-release
7)webmin源
需要先建立webmin的下载说明及位置
vim /etc/yum.repos.d/webmin.repo
[Webmin]
name=Webmin Distribution Neutral
baseurl=http://download.webmin.com/download/yum
enabled=1
9、国内YUM源
阿里源:
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
163源:
wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
搜狐源:
wget http://mirrors.sohu.com/help/CentOS-Base-sohu.repo