在 CentOS 5.0 中安裝 RPMforge 安裝源(翻譯)

來源:互聯網
上載者:User

    安裝 RPMforge

    RPMforge 是 Dag、Dries 和其它軟體包的組合。它們為 CentOS 提供了超過 4000 個軟體包,包括 mplayer、xmms-mp3 和其它流行的媒體播放工具。RPMforge 不是紅帽子 Linux 產品或 CentOS 的組成部分,但它是為這些 Linux 套件而設計的。

    注釋:因為這個安裝源不是 CentOS 本身的組成部分,所以有關支援人員的問題應當向 RPMforge 的維護者發送。

    RPMforge 軟體包以 rpm 格式提供,並且一般都是可用的。必需注意,有一些包比 CentOS 官方提供的版本要新,所以你不應當盲目地安裝。在升級代替 CentOS 官方提供的軟體包之前,你應當確保不要破壞任何重要的東西。雖然大多數情況下你可以改正任何錯誤,但最好還是避免類似的情況發生。

    在 CentOS 5.0 下的使用

    如果你打算應用這個軟體倉庫,你可能希望安裝 Priorities,因為 RPMforge 裡的一些包比它在 ContOS 裡的對應的包的版本要新。

    下面的注釋顯示了 yum 的維護者的感想。但是,從實踐的觀點來看,如果你希望使用 RPMforge 安裝源,你就沒有辦法避免這些 ContOS 原來的軟體包被覆蓋。並且,關於“yum-priorities”外掛程式,還沒有問題報告。

    注釋:請注意 yum 的上遊維護者 Seth Vidal 於 2009 年 9 月關於“yum priorities”的說法。

    ... 引入,最後部分:(同樣的,大多數人最終還是建立了“yum-priorities”)

    天哪,我希望人們不要建立 yum priorities。關於 priorities 的東西是如此之多,真讓我望而生畏。它幾乎讓我想起了 apt “pinning”,並且想出聲叫罵。

    1.1 Priorities(優先權)

    用於 CentOS 5 安裝源的 yum-priorities 軟體包:
    yum install yum-priorities
    (安裝 YUM 優先權外掛程式,產生 /etc/yum/pluginconf.d/priorities.conf 檔案)

    在 CentOS 5 中,外掛程式預設是可用的。

    可以編輯 /etc/yum/pluginconf.d/priorities.conf 檔案確保 yum-priorities 是可用的,確認它包含下面一些文本行:
    [main]
    enabled=1  (預設)

    編輯 /etc/yum.repos.d/ 路徑下的 .repo 檔案,通過添加以下文本行來建立 priorities:
    priority=N

    對應於每個安裝源入口,N 是一個從 1 到 99 的整數。

    建議的配置是(CentOS-Base.repo檔案):
    [base], [addons], [updates], [extras] ... priority=1
    [centosplus], [contrib] ... priority=2

    對第三方安裝源,比如 rpmforge(rpmforge.repo檔案)等等,priority=N (N 是一個大於 10 的你喜歡的整數)

    1.2 RPMforge

    可以在 http://dag.wieers.com/packages/ 獲得 RPMforge 軟體包的一個完整的列表。

    下載 rpmforge-release 包。選擇以下兩個連結中匹配你的 OS 架構(i386/x86_64)的那個下載。如果不能確定是那種架構,請運行 uname -i 命令。

    i386 http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.1-1.el5.rf.i386.rpm
    x86_64 http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.1-1.el5.rf.x86_64.rpm

    為了使安裝源可用,首選的可獲得和安裝的 rpmforge-release 包只能是上面列出的兩個中的一個。

    安裝 DAG 的 GPG key
    rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt

    校正下載的包:
    rpm -K rpmforge-release-0.5.1-1.el5.rf.*.rpm
    校正正確,結果顯示:
    rpmforge-release-0.5.1-1.el5.rf.i386.rpm: (sha1) dsa sha1 md5 gpg OK

    安全警告:rpmforge-release 包把 GPG keys 匯入了 RPM 資料庫。

    只要你通過了注入軟體包的 key 的 md5 校正和,並且信任 Dag, et al., 那麼它們將是安全可信的。

    安裝 rpmforge-release 包

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

    這將在 /etc/yum.repos.d 添加 yum 安裝源設定檔 rpmforge.repo 和 rpmforge-testing.repo(供測試用),並匯入合適的 GPG keys。

    rpmforge.repo 檔案內容為:

    ### Name: RPMforge RPM Repository for Red Hat Enterprise 5 - dag
    ### URL: http://rpmforge.net/
    [rpmforge]
    name = Red Hat Enterprise $releasever - RPMforge.net - dag
    baseurl = http://apt.sw.be/redhat/el5/en/$basearch/rpmforge
    mirrorlist = http://apt.sw.be/redhat/el5/en/mirrors-rpmforge
    #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

    rpmforge-testing.repo 檔案內容為:

    ### Name: RPMforge RPM Repository for Red Hat Enterprise 5 - dag
    ### URL: http://rpmforge.net/
    [rpmforge-testing]
    name = Red Hat Enterprise $releasever - RPMforge.net - test
    baseurl = http://apt.sw.be/redhat/el5/en/$basearch/test
    enabled = 0
    protect = 0
    gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag
    gpgcheck = 0

    這時。你可以配置 RPMForge 安裝源的優先權(priority),如果原先沒有配置 CentOS 安裝源的優先權,這時也可以配置。

    用一下命令進行測試:

    yum check-update

    它將輸出類似以下兩行資訊:

    Loading "priorities" plugin
    ...
    76 packages excluded due to repository priority protections

    在你的 CentOS 系統中,上面的數字可能不同,但是它表明有一些包被排除在外了。

    如果看到上述資訊,它表明 RPMforge 安裝源和優先順序配置已經起作用了。於是可以試著運行類似 yum install mplayer     如果看到上述資訊,它表明 RPMforge 安裝源和優先順序配置已經起作用了。於是可以試著運行類似 yum install mplayer     如果看到上述資訊,它表明 RPMforge 安裝源和優先順序配置已經起作用了。於是可以試著運行類似 yum install mplayer 命令來安裝一些軟體了。

    注-1:

    原文地址如下:
    http://wiki.centos.org/AdditionalResources/Repositories/RPMForge
    本文只選擇翻譯了與 CentOS 5.0 有關的部分,並在保持原文語義的情況下加入了部分作者的解釋。

    注-2:

    篇章簡介:YUM 可以通過加入第三方的安裝源來安裝一些軟體包,本文安裝的 RPMForge 就是這樣一個例子。這就帶來一個問題,如果第三方的安裝源裡有些軟體包比 CentOS 本身預裝的對應軟體包版本要新的話,就會自動安裝較新的版本來代替 CentOS 預裝的軟體版本,如果盲目地更新進行升級,可能是草率和不明智的,這有可能帶來一些潛在的安全和管理問題。

    於是,YUM 引入了一種機制,就是依靠“優先權”來對下載源的優先順序進行排隊。這個是靠 yum-priorities 外掛程式來實現的。而要應用這個特性,需要安裝這個外掛程式並配置使其起作用,並在 repo 配置裡加入 priority=N 來定義優先順序別,這個整數數字(1~99)越小,優先順序越高。這樣一來,如果不同的下載源有軟體包重疊,優先順序低的就被保護和排除(excluded)了,不會被檢測(check)到也不會被更新(update)。

    ==============
    原文附錄如下:
    ==============

    Installing RPMforge

    RPMforge is a collaboration of Dag, Dries, and other packagers. They provide over 4000 packages for CentOS, including mplayer, xmms-mp3, and other popular media tools. It is not part of RedHat or CentOS but is designed to work with those distributions.

    Note: Because this repository is NOT part of CentOS, you should direct support questions to its maintainers.

    Packages are supplied in RPM format and in most cases are ready to use. Beware that some packages are newer than the official CentOS versions and you should not blindly install those packages. Before you replace a CentOS package you should make sure that will not break anything important. In most cases you can revert any mistakes but it is best to avoid the mess.

    CentOS 5

    If you wish use this repository, you may wish to install Priorities, as a few packages in RPMforge are newer than their counterparts in the CentOS base repositories.

    The note below shows the feelings of the yum maintainer but, from a practical standpoint, you have no other way to save packages from being overwritten if you wish to use the RPMforge repository. And, as of yet, no real world problems have been reported with regard to the 'yum-priorities' plugin.

     Note: Please note that the upstream maintainer of yum, Seth Vidal, had the following to say about 'yum priorities' in September 2009.

    ... lead in, ending: (same way most people end up setting up 'yum-priorities' anyway)

    Gosh, I hope people do not set up yum priorities. There are so many things about priorities that make me cringe all over. It could just be that it reminds me of apt 'pinning' and that makes me want to hurl.

    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:
    [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)

    1.2. RPMforge
    You can find a complete listing of the RPMforge package packages at http://dag.wieers.com/packages/

    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
    i386 http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.1-1.el5.rf.i386.rpm
    x86_64 http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.1-1.el5.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

    verify the package you have downloaded
    rpm -K rpmforge-release-0.5.1-1.el5.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.1-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:
    Loading "priorities" plugin
    ...
    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

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.