Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2153790
  • 博文数量: 227
  • 博客积分: 10521
  • 博客等级: 上将
  • 技术积分: 3452
  • 用 户 组: 普通用户
  • 注册时间: 2006-10-20 14:59
个人简介

低调做人,高调做事!

文章分类

全部博文(227)

文章存档

2013年(4)

2012年(8)

2011年(16)

2010年(24)

2009年(92)

2008年(83)

分类: LINUX

2012-05-22 11:47:05

RPMForge拥有4000多种CentOS的软件包,被CentOS社区认为是最安全也是最稳定的一个软件仓库。


一、安装yum-priorities插件。

这个插件是用来设置yum在调用软件源时的顺序的。因为官方提供的软件源,都是比较稳定和被推荐使用的。因此,官方源的顺序要高于第三方源的顺序。如何保证这个顺序,就需要安装yum-priorities这插件了。

shell> yum install yum-priorities

安装完后需要设置/etc/yum.repos.d/ 目录下的.repo相关文件(如CentOS-Base.repo),在这些文件中插入顺序指令:priority=N  (N为1到99的正整数,数值越小越优先)

一般的配置是这样的:
[base], [addons], [updates], [extras] ... priority=1
[centosplus],[contrib] ... priority=2
其他第三的软件源为:priority=N  (推荐N>10)


如我的CentOS-Base.repo配置为:

# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#

[base]
name=CentOS-$releasever - Base
mirrorlist=
#baseurl=
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
priority=1

#released updates
[updates]
name=CentOS-$releasever - Updates
mirrorlist=
#baseurl=
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
priority=1

#packages used/produced in the build but not released
[addons]
name=CentOS-$releasever - Addons
mirrorlist=
#baseurl=
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
priority=1

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
mirrorlist=
#baseurl=
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
priority=1

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
mirrorlist=
#baseurl=
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
priority=2

#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib
mirrorlist=
#baseurl=
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
priority=2



二、下载与安装相应rpmforge的rpm文件包

1,下载rpmforge的rpm最新文件包
32位系统
shell> wget

64位系统
shell> wget

如果您不清楚您的系统内核,你可以使用uname -i命令来查看您的内核信息。

2,安装DAG的PGP Key
shell> rpm --import

3,验证rpmforge的rpm文件包
shell> rpm -K rpmforge-release-0.5.2-2.el5.rf.*.rpm

4,安装rpmforge的rpm文件包
shell> rpm -i rpmforge-release-0.5.2-2.el5.rf.*.rpm

5,设置/etc/yum.repos.d/rpmforge.repo文件中源的级别,就是添加priority=11这句。
如我的rpmforge.repo文件内容:

### Name: RPMforge RPM Repository for Red Hat Enterprise 5 - dag
### URL:
[rpmforge]
name = Red Hat Enterprise $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=11



三、测试

1,测试升级
shell> yum check-update

输出信息应该会有以下两行:
Loading "priorities" plugin
...
XX packages excluded due to repository priority protections

2,安装下xmms音乐播放器试试,如果安装成功了就没有问题了。
shell> yum install xmms
shell> yum install xmms-mp3

参考文献:


阅读(3426) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~