默认centos自带的源少了很多好软件,所以需要添加第三方源
一、安装CentOS yum源优先级插件yum-priorities
yum install yum-plugin-priorities.noarch
二、设置CentOS默认yum源的优先级为最高
cd /etc/yum.repos.d/ #进入yum源目录
vi CentOS-Base.repo #在[base]、[updates]、[extras]组下面添加priority=1,在[centosplus]、[contrib]组下面添加priority=2
################################################################
[base]
name=CentOS-$releasever - Base
mirrorlist=
#baseurl=
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
priority=1
[updates]
name=CentOS-$releasever - Updates
mirrorlist=
#baseurl=
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
priority=1
[extras]
name=CentOS-$releasever - Extras
mirrorlist=
#baseurl=
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
priority=1
[centosplus]
name=CentOS-$releasever - Plus
mirrorlist=
#baseurl=
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
priority=2
[contrib]
name=CentOS-$releasever - Contrib
mirrorlist=
#baseurl=
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
priority=2
###############################################################
备注:priority的优先级为1到99,设置为1即优先级最高,1-10为系统保留,第三方yum源的优先级从11-99
三、安装epel yum源
rpm -ivh
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
vi /etc/yum.repos.d/epel.repo #修改epel yum源优先级,priority=11
###############################################################
[epel]
name=Extra Packages for Enterprise Linux 6 - $basearch
#baseurl=
mirrorlist=
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
priority=11
#################################################################
四、安装rpmforge yum源
wget
wget
rpm --import RPM-GPG-KEY.dag.txt
rpm -ivh rpmforge-release-0.5.2-2.el6.rf.i686.rpm
vi /etc/yum.repos.d/rpmforge.repo #修改rpmforge yum源优先级,priority=12
#################################################################
[rpmforge]
name = RHEL $releasever - RPMforge.net - dag
baseurl =
mirrorlist =
#mirrorlist = file:///etc/yum.repos.d/mirrors-rpmforge
enabled = 1
protect = 0
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag
gpgcheck = 1
priority=12
#################################################################
五、安装rpmfusion yum源
rpm -ivh
vi /etc/yum.repos.d/rpmfusion-free-updates-testing.repo #修改rpmfusion yum源优先级,priority=13
#################################################################
[rpmfusion-free-updates-testing]
name=RPM Fusion for EL 6 - Free - Test Updates
#baseurl=
mirrorlist=
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmfusion-free-el-6
priority=13
系统运维 温馨提醒:qihang01原创内容©版权所有,转载请注明出处及原文链接
#################################################################
六、安装atomic yum源
wget #下载
sh ./atomic #安装
vi /etc/yum.repos.d/atomic.repo #修改atomic yum源优先级,priority=14
##############################################################
[atomic]
name = CentOS / Red Hat Enterprise Linux $releasever - atomicrocketturtle.com
mirrorlist =
#mirrorlist =
enabled = 1
priority = 1
protect = 0
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY.art.txt
gpgcheck = 1
priority=14
##############################################################
七、更新yum软件包
yum check-update
阅读(34399) | 评论(0) | 转发(2) |