引言:
CentOS自带的 yum源中 rpm包数量有限,很多时候找不到我们需的软件
包,(例如:要安装网络连接查看软件 iftop ,默认设置下无法使用 yum命令安
装),下面教大家在 CentOS 6.2 中(以 32 位系统为例, 64 位系统安装方法一
样),使用第三方 yum源来安装更多软件包。
一、安装 CentOS yum源优先级插件 yum-priorities
yum install yum-priorities # 输入 y 安装
二、设置 CentOS默认 yum源的优先级为最高
系统运维 www.osyunwei.com 温馨提醒: qihang01 原创内容 ?版权所有 , 转载
请注明出处及原文链接
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=http://mirrorlist.centos.org/?release=$releasever&arch=$ba
search&repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
priority=1
[updates]
name=CentOS-$releasever - Updates
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$ba
search&repo=updates
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearc
h/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
priority=1
[extras]
name=CentOS-$releasever - Extras
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$ba
search&repo=extras
#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch
/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
priority=1