# CentOS官方推荐的第三方软件仓库和安装方法

repository好像一般翻译成源，大家都说从什么源安装什么软件，但是我不明白repositories怎么就成源了呢，貌似应该是软件仓库的意思才对啊...也许是约定俗称的吧，有知道出处的XDJM请不吝赐教...
CentOS中文资料不好找，虽然看英文对我还是比较容易理解的，但是看了这么多免费的资料，想想还是要给点回报的，所有有了这篇翻译的小文章...
--------------------------------------------------------------------------------------
*************************************************************
3rd Party Repositories
*************************************************************

RPMForge - This repository is a collaboration of Dag (who also maintains an individual archive), Dries, and other packagers. They provide over 4000 packages for CentOS, including mplayer, xmms-mp3, and other popular media tools. You can find more information about rpmforge at http://rpmforge.net/ or read the instructions on Installing RPMForge http://wiki.centos.org/AdditionalResources/Repositories/RPMForge

This repository is considered by many in the community to be stable and safe.

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

-----------------------------------------------------------------------------------------
rpmforge的安装方法

CentOS 5

You should make sure that you have Priorities installed.

1.1. Priorities

yum-priorities is available in the CentOS 5 repositories:

yum install yum-priorities

Plugins are enabled in CentOS 5 by default.

Make sure that yum-priorities is enabled by editing the /etc/yum/pluginconf.d/priorities.conf file, and ensuring that it contains the following lines:

[main]
enabled=1

Edit the .repo files in /etc/yum.repos.d/ and set up priorities by adding the line:

priority=N

to a repository entry, where N is an integer number from 1 to 99.

The recommended settings are:

[centosplus],[contrib] ... priority=2
Third Party Repos such as rpmforge ... priority=N  (where N is > 10 and based on your preference)

1.2. RPMforge

Download the rpmforge-release package. Choose one of the two links below, depending on your architecture. If you are unsure of which one to use you can check your architecture with the command uname -i

i386 http://apt.sw.be/redhat/el5/en/i386/RPMS.dag/rpmforge-release-0.3.6-1.el5.rf.i386.rpm

x86_64 http://apt.sw.be/redhat/el5/en/x86_64/RPMS.dag/rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm

(You can find a complete list of rpmforge-release package packages at http://dag.wieers.com/packages/rpmforge-release/ but it is recommended that you use one of the two listed above).

Install DAG's GPG key

rpm --import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt

rpm -K rpmforge-release-0.3.6-1.el5.rf.*.rpm

Security warning: The rpmforge-release package imports GPG keys into your RPM database. As long as you have verified the package and trust Dag then it should be safe.

Install the package

rpm -i rpmforge-release-0.3.6-1.el5.rf.*.rpm

This will add a yum repository config file and import the appropriate GPG keys. At this point, you can set the priority of the RPMForge repository, and also of the CentOS repositories if you have not done so yet.

Test with this command:

yum check-update

It should output these two lines:

...
76 packages excluded due to repository priority protections

The number above may differ, but there should be several packages shown as being excluded.

If so then it looks like things are working so try installing something like this

yum install mplayer
----------------------------------------------------------------------------------------
1、确认系统是否安装了priority这个yum的插件，这个插件用来保证安装软件时候软件仓库先后次序，一般是默认先从官方base或者镜像安装，然后从社区用户contribute的软件中安装，再从第三方软件仓库中安装。当然这个次序可以自己更改，为了安全和稳定还是依照这个次序吧....
yum install yum-priorities

[main]
enabled=1

http://wiki.centos.org/PackageManagement/Yum/Priorities
----------------------------------------------------------------------------------------

After the plugin is installed, make sure that it is enabled. You can do this by editing the /etc/yum/pluginconf.d/priorities.conf file, and ensuring that it contains the following lines:

[main]
enabled=1

Some packages specify obsoletes in their metadata. This property of a package specifies which old packages with a different name the package replaces. This can intefere with the priority protection of packages, if a package from a low-priority repository contains an obsoletion for package from a high-priority repository. For instance, if the gconfmm2 package was installed from a high-priority repository, and another package (say gconfmm20) claims to replace the obsolete gconfmm2 package, Yum will replace the gconfmm2 package with the gconfmm20 package. This plugin can prevent such upgrades, by adding the following line to the main section of /etc/yum/pluginconf.d/priorities.conf:

check_obsoletes=1
---------------------------------------------------------------------------------------
2、现在就可以手动编辑 /etc/yum.repos.d/ 目录中后缀为.repos的文件来设置软件仓库的先后次序（感觉我这个翻译不是很适当，priority主要还是个权限问题，但一时找不到更好的词，就这样吧）....

priority=N(N是整数，范围从1-99)

[centosplus],[contrib] ... priority=2
Third Party Repos such as rpmforge ... priority=N  (where N is > 10 and based on your preference)

-------------------------------------------------------------------------------------
[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
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
--------------------------------------------------------------------------------------
3、现在开始安装rpmforge的软件仓库
a 先下载rpmforge的安装包
i386 http://apt.sw.be/redhat/el5/en/i386/RPMS.dag/rpmforge-release-0.3.6-1.el5.rf.i386.rpm

x86_64 http://apt.sw.be/redhat/el5/en/x86_64/RPMS.dag/rpmforge-release-0.3.6-1.el5.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.3.6-1.el5.rf.*.rpm

d 安装包
rpm -i rpmforge-release-0.3.6-1.el5.rf.*.rpm

e 更改 /etc/yum.repos.d/rpmforge.repo 配置文件，就是添加
priority=3（或者1.2.4....）这一句

f 现在就可以使用rpmforge这个软件仓库了....

g 安装mplayer这样的软件也就是yum install mplayer就可以了，方便了很多啊....
--------------------------------------------------------------------------------------
*************************************************************
Request Tracker - This repository provides a yum based install for the popular request tracker ticketing system and its dependencies. This repository is available at http://campus.fct.unl.pt/paulomatos/rt/repository/3.4.x/rt-3.4.x.repo and the centos news article is at http://www.centos.org/modules/news/article.php?storyid=114

Note: - If you are planning to use this repository and have ProtectBase configured for your base repositories, you need to "protect" this repository also, as it has to overwrite at least two packages from the base distribution (namely mod_perl). And it has some contents that would be overwritten by the rpmforge repository, if the rt repository isn't "protected".

Note: - If you are using this repository and the rpmforge repository and you don't have the Protectbase or Priorities plugin installed, you have to put the following exclude into your /etc/yum.repos.d/rpmforge.repo file:

exclude=perl-DBIx-SearchBuilder

Otherwise installation will complain about "Missing Dependency: perl(DBD::Oracle) is needed by package perl-DBIx-SearchBuilder."

*************************************************************
KBS-Extras - This site provides a rebuild of Fedora Extras for CentOS, as well as number of other packages. This repository is available at http://centos.karan.org and has a reputation for being stable and safe.

-------------------------------------------------------------------------------------

Fedora Extras rebuild Repository：

yum kb-centos-extras http://centos.karan.org/el4/extras/stable/$ARCH/RPMS Misc Packages rebuild Repository： 下载 http://centos.karan.org/kbsingh-CentOS-Misc.repo ，放到 /etc/yum.repos.d/ 即可。如果要保证更新，使用up2date manager, 在这个文件里 /etc/sysconfig/rhn/sources 加上下面一句: yum kb-centos-misc http://centos.karan.org/el4/misc/stable/$ARCH/RPMS

rpm --import http://centos.karan.org/RPM-GPG-KEY-karan.org.txt
-------------------------------------------------------------------------------------
ps: CentOS 5.2说，   /etc/sysconfig/rhn/sources   已经不再使用，所以的仓库管理都通过yum设置。事实上up2date是Red Hat Network以前使用的东东，现在已经用 yum update替代了，所以就无需去更改  /etc/sysconfig/rhn/sources 文件了，配置priority以后就没问题了...

# CentOS NOTE: This file is deprecated and no longer used, all system management
# is now handled via yum, look at yum's configs to manage repositories etc

*************************************************************
kde-redhat.sf.net - This repository provides more recent (bleeding-edge) versions of KDE for use on redhat based systems. This repository has a decent reputation, and a sizable support community.

Note: - This will update MANY items to newer versions including all of KDE, QT, samba, etc. This seems to work OK on all machines I have tried, but your machine will be far from CentOS with many changes to the [Base] CentOS Operating System. Information concerning setup is available here: http://kde-redhat.sourceforge.net/

*************************************************************
ATrpms - This repository provides many bleeding-edge applications and media utilities such as myth-tv. This repository is available at http://atrpms.net/

This repository has been reported to replace system packages and may cause stability issues. Use at your own risk. - this is only true for CentOS 4 and below.

The CentOS 5/RHEL 5 repository from atrpms.net is safe to use, if you only use the stable version. Packages in there do not overwrite system packages.

If you also enable testing and bleeding, you are on your own again - these two do overwrite system packages.

PS：这个仓库对每个版本都有三个不同的软件版本，目录为bleeding\stable\testing...查看： http://dl.atrpms.net/el5-i386/atrpms/所以CentOS  所以wiki的作者在这里用these two...

-------------------------------------------------------------------------------------

a、首先导入PGP key
rpm --import http://ATrpms.net/RPM-GPG-KEY.atrpms
b、然后配置仓库文件，方法有两种

# Name:ATrpms
# URL: http://atrpms.net/

[atrpms]
name=Fedora Core $releasever -$basearch - ATrpms
baseurl=http://dl.atrpms.net/el5-i386/atrpms/stable/
#baseurl=http://dl.atrpms.net/el5-i386/atrpms/bleeding/
#baseurl=http://dl.atrpms.net/el5-i386/atrpms/testing/
enable=1
protect=0
gpgkey=http://ATrpms.net/RPM-GPG-KEY.atrpms
gpgcheck=1
priority=5

（PS：这个是我个人建议的配置，官方建议配置如下：）

Make sure the following lines are included in /etc/yum.conf:

[atrpms]
name=Fedora Core $releasever -$basearch - ATrpms
baseurl=http://dl.atrpms.net/f$releasever-$basearch/atrpms/stable
gpgkey=http://ATrpms.net/RPM-GPG-KEY.atrpms
gpgcheck=1
（PS:  yum.conf里面有这样的语句， # PUT YOUR REPOS HERE OR IN separate files named file.repo， 放在这个下面即可）

*************************************************************
Extra Packages for Enterprise Linux (EPEL)- This repository (See http://fedoraproject.org/wiki/EPEL) provides rebuilds of Fedora packages for EL4 and EL5. Install the appropriate epel-release for EL4 or epel-release for EL5 package to configure. This repo has made efforts not to replace system packages and in some cases has endeavored to directly address CentOS compatibility, but may not mix well with other 3rd party repos. So, make SURE you are using the Priorities yum plugin if you are using EPEL ... especially if you are using it with other 3rd party repos.

-------------------------------------------------------------------------------------

Extra Packages for Enterprise Linux (EPEL) is a volunteer-based community effort from the Fedora project to create a repository of high-quality add-on packages that complement the Fedora-based Red Hat Enterprise Linux (RHEL) and its compatible spinoffs such as CentOS or Scientific Linux.

EPEL是由一个志愿者组成的社区，为完全基于fedora的RHEL（以及兼容的CentOS和其他用于科研用途的Linux）打造高质量软件包的软件仓库。

yum -i epel-release-5-3.noarch.rpm

*************************************************************

*************************************************************
PS:翻译太累了，看懂英文对技术人员来说不是大问题，要译成中文还要“信、达、雅”就是mission impossible了...
*************************************************************

10-29 5987

01-21 1693
02-24 48
05-23 9964
06-26 64
09-22 890
11-28 1923
01-24 274
11-25 2921
11-04 173
10-10 723
07-17 1万+
10-08 78
05-20 290