CentOS 6.2第三方软件仓库介绍(yum源)及rpmforge安装方法

CentOS官方社区wiki:http://wiki.centos.org/FrontPage——>

HowTos——>Package Management——>CentOS Repositories

Repositories好像一般翻译成,大家都说从什么源安装什么软件,但是我不明白repositories怎么就成源了呢,貌似应该是软件仓库的意思才对啊...也许是约定俗称的吧。

http://wiki.centos.org/AdditionalResources/Repositories

官方推荐的第三方yum源:配置第三方软件库使你的软件库更加丰富。以下简单的讲下配置的步骤。

RPMForge - This repository is a collaboration of Dag (who also maintains anindividual archive) and other packagers. The archive provides over 10,000 packages for CentOS, including mplayer, xmms-mp3 and other popular media tools. You can read the installation instructions atInstalling RPMForge. This repository is considered by many in the community to be stable and safe.

RPMForge拥有4000多种CentOS的软件包,被CentOS社区认为是最安全也是最稳定的一个软件仓库。
主页:http://rpmforge.net/
安装指南:http://wiki.centos.org/AdditionalResources/Repositories/RPMForge

RPMforge for CentOS 6
The default RPMforge repository does not replace any CentOS base packages. In the past it used to, but those packages are now in a separate repository (rpmforge-extras) which is disabled by default.
You can find a complete listing of the RPMforge package packages at http://packages.sw.be/ 
Download the rpmforge-release package. Choose one of the two links below, selecting to match your host's architecture. If you are unsure of which one to use you can check your architecture with the command uname -i
i686 http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm
x86_64 http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
The preferred rpmforge-release package to retrieve and to install in order to enable that repository is one of the two listed above.
Install DAG's GPG key: 
     rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt

If you get an error message like the following the key has already been imported:
error: http://apt.sw.be/RPM-GPG-KEY.dag.txt: key 1 import failed.

Verify the package you have downloaded: 
    rpm -K rpmforge-release-0.5.2-2.el6.rf.*.rpm

Security warning: The rpmforge-release package imports GPG keys into your RPM database. As long as you have verified the md5sum of the key injection package, and trust Dag, et al., then it should be as safe as your trust of them extends.
Install the package:
    rpm -i rpmforge-release-0.5.2-2.el6.rf.*.rpm

This will add a yum repository config file and import the appropriate GPG keys.
Then try to install something like this :
    yum install htop

 

综上所述:

1、确认系统是否安装了priority这个yum的插件,这个插件用来保证安装软件时候软件仓库先后次序,一般是默认先从官方base或者镜像安装,然后从社区用户contribute的软件中安装,再从第三方软件仓库中安装。当然这个次序可以自己更改,为了安全和稳定还是依照这个次序吧....
yum install yum-priorities
安装完以后查看 /etc/yum/pluginconf.d/priorities.conf 文件,确认文件中有这一行
 [main]
 enabled=1
同时,为了防止一些已经废弃(obsoletes)的包的出现,在这个文件[main]范围内加上check_obsoletes=1
在一个软件包的头信息(metadata)里面已经标注这个包作废不再使用,但是在使用priorities这个插件以后,可以会导致低权限软件仓库中的软件包安装替换了从高权限软件仓库中安装的软件包。比如一个低限软件仓库中的软件包叫做gconfmm20而高权限软件仓库的软件包叫做gconfmm2,系统会认为gconfmm20版本更高...这就引起了错误...
上面这一段译自:
http://wiki.centos.org/PackageManagement/Yum/Priorities

2、现在就可以手动编辑 /etc/yum.repos.d/ 目录中后缀为.repos的文件来设置软件仓库的先后次序(感觉我这个翻译不是很适当,priority主要还是个权限问题,但一时找不到更好的词,就这样吧)
priority=N(N是整数,范围从1-99)
官方的源推荐配置是
[base], [addons], [updates], [extras] ... priority=1 
[centosplus],[contrib] ... priority=2
Third Party Repos such as rpmforge ... priority=N  (where N is > 10 and based on your preference)
配置范例:CentOS-Base.repo文件
-------------------------------------------------------------------------------------
[base]
name=CentOS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5
priority=1

#released updates 
[updates]
name=CentOS-$releasever - Updates
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5
priority=1

#packages used/produced in the build but not released
[addons]
name=CentOS-$releasever - Addons
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=addons
#baseurl=http://mirror.centos.org/centos/$releasever/addons/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5
priority=1

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5
priority=1

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5
priority=2

#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
#baseurl=http://mirror.centos.org/centos/$releasever/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5
priority=2
--------------------------------------------------------------------------------------

对上面1,2总结如下:yum是centos下很方便的rpm包管理工具,首先,需要安装yum-priorities插件:
   yum install yum-priorities –y
该插件的作用主要是设置调用源时的优先级的,一般将官方的优先级设置为最高。

Make sure that yum-priorities is enabled by editing.
   vi /etc/yum/pluginconf.d/priorities.conf
ensuring that it contains the following lines:
   [main]
   enabled=1

用vi编辑CentOS-Base.repo文件:
   vi /etc/yum.repos.d/CentOS-Base.repo
在每个[]段的最后加上priority=[]字段来设置每个镜像的优先级,1为最高,99为最低。
一般的配置为:[base], [updates], [extras] … priority=1
[CentOSplus],[contrib] … priority=2

Third Party Repos such as rpmforge ... priority=N  (where N is > 10 and based on your preference)
然后保存。

3、现在开始安装rpmforge的软件仓库
a 先下载rpmforge的安装包
  i386        http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el4.rf.i386.rpm
  x86_64   http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el4.rf.x86_64.rpm
b 安装DAG的PGP Key
  rpm --import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
c 验证下载包的完整性
  rpm -K rpmforge-release-0.5.2-2.el6.rf.*.rpm
d 安装包
  rpm -i rpmforge-release-0.5.2-2.el6.rf.*.rpm
e 更改 /etc/yum.repos.d/rpmforge.repo 配置文件,就是添加
  priority=3(或者1.2.4....)这一句
f 现在就可以使用rpmforge这个软件仓库了....
g 安装mplayer这样的软件也就是yum install mplayer就可以了,方便了很多啊

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值