歡迎您光臨本站 註冊首頁

讓CentOS 6 yum源支持更多rpm包的升級

←手機掃碼閱讀     火星人 @ 2014-03-12 , reply:0
  

讓CentOS 6 yum源支持更多rpm包的升級(使用第三方軟體庫EPEL、RPMForge與RPMFusion) 。

在CentOS下運行yum install flash-plugin或yum install mplayer的時候,提示庫里沒有找到這個軟體?為什麼會這樣?因為CentOS是RHEL編譯過來的,去掉了所有關於版權問題的東西。因此,在沒有使用第三方軟體庫的情況下,很多軟體無法用yum install來直接安裝。

EPEL(Extra Packages for Enterprise Linux)軟體庫提供為RHEL系列(4.x、5.x、6.x等等)重新編譯的Fedora組件。這個軟體庫在不替換系統組件方面下了功夫。在某些情況下它嘗試直接針對CentOS兼容性的問題,但堅決否定軟體庫間的兼容性是目標之一。當它與其它第三方軟體庫混合使用時,問題可能會出現。故此,當你使用EPEL時,尤其是當你亦會運用其它件庫的組件時,請確保你使用yum的Priorities插件。

RPMForge庫現在已經擁有超過10000種的CentOS的軟體包,被CentOS社區認為是最安全也是最穩定的一個第三方軟體庫。

下面講解下如何使用EPEL與RPMForge、RPMFusion軟體倉庫:

一、安裝yum-priorities插件。

這個插件是用來設置yum在調用軟體源時的順序的。因為官方提供的軟體源,都是比較穩定和被推薦使用的。因此,官方源的順序要高於第三方源的順序。如何保證這個順序,就需要安裝yum-priorities這插件了。

[root@CentOS ~]# 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 6.0):
# 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=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
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=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
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=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
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=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
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=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
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=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
priority=2



[火星人 ] 讓CentOS 6 yum源支持更多rpm包的升級已經有501次圍觀

http://coctec.com/docs/linux/show-post-68656.html