Differences between revisions 3 and 4

Deletions are marked like this. Additions are marked like this.
Line 9: Line 9:
'''CentOSPlus''' 軟件庫藏有針對 CentOS base 及 CentOS updates 軟件庫內的套件的更新。這些更新套件並不屬於上游的發行,所以在延伸 CentOS 的功能同時犧牲了與上游的兼容性。啟用這個軟件庫會導致 CentOS 與上游有差別。你應該明白這樣做的後果才啟用 '''CentOSPlus'''。對應 [http://mirror.centos.org/centos/4/centosplus/Readme.txt CentOS 4] 及 [http://mirror.centos.org/centos/5/centosplus/Readme.txt CentOS 5] 的 CentOSPlus 自述檔已收錄在上連結。你亦應該瀏覽我們鏡像針對 [http://mirror.centos.org/centos/4/centosplus/ CentOS 4] 或 [http://mirror.centos.org/centos/5/centosplus/ CentOS 5] 的目錄來尋找用的架構。 '''CentOSPlus''' 軟件庫藏有針對 CentOS base 及 CentOS updates 軟件庫內的套件的更新。這些更新套件並不屬於上游的發行,所以在延伸 CentOS 的功能同時犧牲了與上游的兼容性。啟用這個軟件庫會導致 CentOS 與上游有差別。你應該明白這樣做的後果才啟用 '''CentOSPlus'''。你可以瀏覽我們鏡像針對 [http://mirror.centos.org/centos/5/centosplus/ CentOS 5] 或 [http://mirror.centos.org/centos/6/centosplus/ CentOS 6] 的 CentOSPlus 目錄來尋找要使用的架構。
Line 13: Line 13:
||<class="lmimg blue" style="padding:0"> attachment:ArtWork/WikiDesign/icon-admonition-info.png ||||<class="lmtxt blue" style="padding:0" (>'''CentOSPlus''' 軟件庫內亦藏有 '''CentOS Web Stack'''(暫只供 CentOS-4 用)。若你有興趣更新至 '''CentOS Web Stack''',你應該閱讀[:/CentOSWebStack:這頁]。'''CentOS Web Stack''' 包含了針對 Apache (httpd) 2.0.58、MySQL 5.0、PostgreSQL 8.1、Perl 5.88、mod_perl 2、PHP 5.1.6 及 ODBC 的更新。||

舉個例子,你可能只想得到 '''CentOSPlus''' 內的 php-5.x 及 mysql-5.x,但你不需要支援 mysql_pgsql 的 postfix,或者支援新硬件的內核。在你啟用 '''CentOSPlus''' 軟件庫前,你應該閱讀關於 yum 內 '''includepkgs=''' 及/或 '''exclude=''' 選項。要查詢關於這個選項,你可在命令行執行這個指令:
在你啟用 '''CentOSPlus''' 軟件庫前,你應該閱讀 yum 內關於 '''includepkgs=''' 以及 '''exclude=''' 的選項。要查詢這些選項,你可在命令行執行以下指令:
Line 32: Line 30:
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4 <== -CentOS-5 in CentOS5 gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5 <== -CentOS-6 in CentOS-6
Line 50: Line 48:
'''註:''' 若果想使用針對 '''CentOS Web Stack''' 內的 psql 及 mysql 而編譯的 postfix,你便不須加入 "exclude=postfix-*plus*"

你亦須
要在 '''/etc/yum.repos.d/CentOS-Base.repo''' 內的 '''[base]''' 及 '''[update]''' 部份加入下列設定,好使你不會再從它們取得 postfix 套件:
也需要在 '''/etc/yum.repos.d/CentOS-Base.repo''' 內的 '''[base]''' 及 '''[update]''' 部份加入下列設定,好使你不會再從它們取得 postfix 套件:
Line 69: Line 65:
exclude=kernel kernel-devel kernel-smp-* kernel-hugemem* kernel-largesmp* (CentOS 4 only)
exclude=kernel kernel-devel kernel-PAE-* (CentOS 5 only)
}}}

'''註:''' 若果你要應用 XFS 檔案系統,可使用附加的內核模塊,請參考範例 3 及 4。
-----
'''範例 3:''' 我們希望以正規內核應用 XFS 檔案系統 …… 這樣的話便完全不需要 CentOSPlus 軟件庫,你只須如此做:

{{{
yum list available kmod-xfs\*
}}}

所得出的結果會如下(以 CentOS-5 x86_64 為例):

{{{
Available Packages
kmod-xfs.x86_64 0.4-2 extras
kmod-xfs-xen.x86_64 0.4-2 extras
}}}

接著你應該選擇所需的模塊,並用類似以下的指令來安裝它:

{{{
yum install kmod-xfs.i686 xfsdump xfsprogs
}}}

'''註:''' 這個內核模塊亦支援 dmapi,所以若你想應用它,可在上面的安裝指令中加入 dmapi。XFS 的使用細節已經超越這頁的範圍。
-----
'''範例 4:''' 我們已經安裝了 CentOSPlus 的內核(基於某些原因 …… 否則請看範例 3),而我們希望'''同時'''應用 XFS 檔案系統。我們須要編輯 '''/etc/yum.repos.d/CentOS-Base.repo''' 及修改 '''[centosplus]''' 部份內的設定如下:

{{{
enabled=1
includepkgs=kernel* xfs* kmod-xfs* dmapi*
}}}

在 '''[base]''' 及 '''[update]''' 部份你須要作出下列修改:

{{{
exclude=kernel kernel-devel kernel-smp-* kernel-hugemem* kernel-largesmp* (CentOS 4 only)
exclude=kernel kernel-devel kernel-PAE-* (CentOS 5 only)
}}}

在 '''[extra]''' 部份你須要作出下列修改:

{{{
exclude=xfs* kmod-xfs* dmapi*
exclude=kernel kernel-devel kernel-PAE-*
Line 144: Line 95:
此,'''yum-plugin-priorities''' 許你略過在 '''CentOS-Base.repo''' '''[centosplus]''' 部份設定 '''includepkgs=''',但依然能夠更新那些在 '''[base]''' 及 '''[update]''' 軟件庫中被 '''exclude=''' 排除的套件。 此,'''yum-plugin-priorities''' 許你略過在 '''CentOS-Base.repo''' '''[centosplus]''' 小節中 '''includepkgs=''' 的設定,但依然能夠更新那些在 '''[base]''' 及 '''[update]''' 軟件庫中被 '''exclude=''' 排除的套件。
Line 156: Line 107:
~-Translation of revision 24-~ ~-Translation of revision 26-~

CentOSPlus 軟件庫

1. CentOSPlus 軟件庫是甚麼?

CentOSPlus 軟件庫藏有針對 CentOS base 及 CentOS updates 軟件庫內的套件的更新。這些更新套件並不屬於上游的發行,所以在延伸 CentOS 的功能同時犧牲了與上游的兼容性。啟用這個軟件庫會導致 CentOS 與上游有差別。你應該明白這樣做的後果才啟用 CentOSPlus。你可以瀏覽我們鏡像中針對 CentOS 5 或者 CentOS 6 的 CentOSPlus 目錄來尋找要使用的架構。

CentOSPlus 軟件庫包含的所有套件都是更新用的套件。你很可能不會啟用整個 CentOSPlus,而只會選擇其中合用的套件。

在你啟用 CentOSPlus 軟件庫前,你應該閱讀 yum 內關於 includepkgs= 以及 exclude= 的選項。要查詢這些選項,你可在命令行執行以下指令:

man yum.conf

2. 啟用 CentOSPlus 軟件庫

要啟用 CentOSPlus 軟件庫,請編輯 /etc/yum.repos.d/CentOS-Base.repo 檔並尋找 [centosplus] 部份。它的預設內容是:

#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-CentOS-5 <== -CentOS-6 in CentOS-6


範例 1: 我們希望取得 CentOSPlus 內支援 mysql_pgsql 的 postfix。下面是 /etc/yum.repos.d/CentOS-Base.repo 內應有的設定:

#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=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4
includepkgs=postfix-*
exclude=postfix-*plus*

你也需要在 /etc/yum.repos.d/CentOS-Base.repo 內的 [base][update] 部份加入下列設定,好使你不會再從它們取得 postfix 套件:

exclude=postfix-*


範例 2: 我們希望使用 CentOSPlus 的內核,以便能使用 jfs 或 reiserfs 檔案系統及建設工具。我們須要編輯 /etc/yum.repos.d/CentOS-Base.repo 及修改 [centosplus] 部份內的設定如下:

enabled=1
includepkgs=kernel* jfsutils reiserfs-utils

[base][update] 部份你須要作出下列修改:

exclude=kernel kernel-devel kernel-PAE-*


3. yum-plugin-priorities 插件

另一個保護你的系統被 CentOSPlus 軟件庫更新的方法就是採用 yum-plugin-priorities 插件。這是推薦的方法。請按照以上連結內的指引設置 yum-plugin-priorites。編輯 /etc/yum.conf 並加入這行:

plugins=1

你須要在 /etc/yum.repos.d/CentOS-Base.repo 內設定優先次序如下:

[base]
exclude=foo bar
priority=1

[update]
exclude=foo bar
priority=1

[centosplus]
enable=1
priority=2

這樣做會令 [base][update] 軟件庫對比起 [centosplus] 軟件庫有較優先的次序,於是 CentOSPlus 內唯一可以更改 [base][update] 的套件就是在這兩個軟件庫中被 exclude= 排除的套件。

因此,yum-plugin-priorities 允許你略過在 CentOS-Base.repo[centosplus] 小節中 includepkgs= 的設定,但依然能夠更新那些在 [base][update] 軟件庫中被 exclude= 排除的套件。


4. 總結

使用 CentOSPlus 軟件庫比使用其他 CentOS 軟件庫更為危險,因為它容許有多個更新的套件,而且並不是為整體啟用而設計的。

你可應用 CentOSPlus 內的所有套件,但一般的做法是單單選擇所需的套件,然後透過 exclude=includepkgs=(或 exclude=yum-plugin-priorities 插件) 從 CentOSPlus 軟件庫內下載這些套件。

請確定你理解這裡的所有概念,然後才啟用 CentOSPlus 軟件庫。

Translation of revision 26

zh-tw/AdditionalResources/Repositories/CentOSPlus (last edited 2012-05-08 03:06:48 by TimothyLee)