在centos下运行yum install flash-plugin,或者 yum install mplayer 的时候,命令无效?为什么会这样?因为centos是rhel编译过来的,去掉了所有关于版权问题的东西。因此,在没有使用第三方软件库的情况下,很多软件无法用yum install来直接安装。
RPMForge拥有4000多种CentOS的软件包,被CentOS社区认为是最安全也是最稳定的一个软件仓库。下面,我就来讲解下如何使用RPMForge软件仓库:
一、安装yum-priorities插件。
这个插件是用来设置yum在调用软件源时的顺序的。因为官方提供的软件源,都是比较稳定和被推荐使用的。因此,官方源的顺序要高于第三方源的顺序。如何保证这个顺序,就需要安装yum-priorities这插件了。
shell> yum install yum-priorities #安装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.1-1.el5.rf.*.rpm
4,安装rpmforge的rpm文件包
shell> rpm -i rpmforge-release-0.5.1-1.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 #安装xmms的mp3播放插件
[参考]
1,
阅读(971) | 评论(0) | 转发(0) |