CentOSPlus 軟件庫
1. CentOSPlus 軟件庫是甚麼?
CentOSPlus 軟件庫藏有針對 CentOS base 及 CentOS updates 軟件庫內的套件的更新。這些更新套件並不屬於上游的發行,所以在延伸 CentOS 的功能同時犧牲了與上游的兼容性。啟用這個軟件庫會導致 CentOS 與上游有差別。你應該明白這樣做的後果才啟用 CentOSPlus。你可以瀏覽我們鏡像中針對 CentOS 6、CentOS 7 或 CentOS 8 的 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 內核不同之處
我們經常被問到 CentOSPlus 內核與預設(base)內核有甚麼分別?這隨著新發行的內核而異,但以下方法可詳細地列出設定上的差異。你必須同時安裝了預設內核及 Plus 版本的源碼。接著,從一個指令殼執行:
diff -y --width=80 --suppress-common-lines -b -B -d \ /<path/to/default/kernel source>/.config \ /<path/to/Plus/kernel/source>/.config
上述指令的輸出(截至 2015 年 8 月)可以讓你對 CentOSPlus 內核中所包含的改動(主要是額外驅動程式及更多驅動程式選項)有一個概念,但你必須執行該指令才能看見最新的清單。(圖例:> = 加入,< = 刪除,| = 修改)從內核源碼樹的最上層目錄執行 make menuconfig 便可看到每個選項的解釋。
# diff -y --suppress-common-lines -b -B -d 2.6.32-573.3.1.el6.x86_64/.config 2.6.32-573.3.1.el6-centos-plus/.config # awk '{ # gsub(/\t/," "); # i=split($0,myarray,/[<|>]/); # match($0,/([>|<])/,separray); # gsub(/[ ]*$/,"",myarray[1]); # printf("%-40s%2s%-40s\n",myarray[1],separray[0],myarray[2]); # }' config-diff.txt > config-diff.txt.edit # # Linux kernel version: 2.6.32-573.3.1.el6.x86_64 | # Linux kernel version: 2.6.32-573.3.1.el6.centos.plus.x86_64 # Thu Aug 13 22:49:26 2015 | # Fri Aug 14 00:54:22 2015 # CONFIG_ARPD is not set | CONFIG_ARPD=y # CONFIG_IPX is not set | CONFIG_IPX=m # CONFIG_ATALK is not set | CONFIG_IPX_INTERN=y > CONFIG_ATALK=m > CONFIG_DEV_APPLETALK=m > CONFIG_IPDDP=m > CONFIG_IPDDP_ENCAP=y > CONFIG_IPDDP_DECAP=y # CONFIG_IRDA is not set | CONFIG_IRDA=m > # IrDA protocols > CONFIG_IRLAN=m > CONFIG_IRNET=m > CONFIG_IRCOMM=m > CONFIG_IRDA_ULTRA=y > # IrDA options > CONFIG_IRDA_CACHE_LAST_LSAP=y > CONFIG_IRDA_FAST_RR=y > # CONFIG_IRDA_DEBUG is not set > # Infrared-port device drivers > # SIR device drivers > CONFIG_IRTTY_SIR=m > # Dongle support > CONFIG_DONGLE=y > CONFIG_ESI_DONGLE=m > CONFIG_ACTISYS_DONGLE=m > CONFIG_TEKRAM_DONGLE=m > CONFIG_TOIM3232_DONGLE=m > CONFIG_LITELINK_DONGLE=m > CONFIG_MA600_DONGLE=m > CONFIG_GIRBIL_DONGLE=m > CONFIG_MCP2120_DONGLE=m > CONFIG_OLD_BELKIN_DONGLE=m > CONFIG_ACT200L_DONGLE=m > CONFIG_KINGSUN_DONGLE=m > CONFIG_KSDAZZLE_DONGLE=m > CONFIG_KS959_DONGLE=m > # FIR device drivers > CONFIG_USB_IRDA=m > CONFIG_SIGMATEL_FIR=m > CONFIG_NSC_FIR=m > CONFIG_WINBOND_FIR=m > CONFIG_SMC_IRCC_FIR=m > CONFIG_ALI_FIR=m > CONFIG_VLSI_FIR=m > CONFIG_VIA_FIR=m > CONFIG_MCS_FIR=m # CONFIG_SCSI_DPT_I2O is not set | CONFIG_SCSI_DPT_I2O=m # CONFIG_SCSI_BUSLOGIC is not set | CONFIG_SCSI_BUSLOGIC=m # CONFIG_PATA_CMD640_PCI is not set | CONFIG_PATA_CMD640_PCI=m # CONFIG_PATA_CS5520 is not set | CONFIG_PATA_CS5520=m # CONFIG_PATA_CS5530 is not set | CONFIG_PATA_CS5530=m # CONFIG_PATA_CYPRESS is not set | CONFIG_PATA_CYPRESS=m # CONFIG_PATA_EFAR is not set | CONFIG_PATA_EFAR=m # CONFIG_PATA_HPT3X3_DMA is not set | CONFIG_PATA_HPT3X3_DMA=y # CONFIG_PATA_TRIFLEX is not set | CONFIG_PATA_TRIFLEX=m # CONFIG_PATA_MPIIX is not set | CONFIG_PATA_MPIIX=m # CONFIG_PATA_NS87410 is not set | CONFIG_PATA_NS87410=m # CONFIG_PATA_NS87415 is not set | CONFIG_PATA_NS87415=m # CONFIG_PATA_OPTI is not set | CONFIG_PATA_OPTI=m # CONFIG_PATA_OPTIDMA is not set | CONFIG_PATA_OPTIDMA=m # CONFIG_PATA_RADISYS is not set | CONFIG_PATA_RADISYS=m # CONFIG_PATA_RZ1000 is not set | CONFIG_PATA_RZ1000=m # CONFIG_PATA_SC1200 is not set | CONFIG_PATA_SC1200=m # CONFIG_PATA_WINBOND is not set | CONFIG_PATA_WINBOND=m # CONFIG_I2O is not set | CONFIG_I2O=m > CONFIG_I2O_LCT_NOTIFY_ON_CHANGES=y > CONFIG_I2O_EXT_ADAPTEC=y > CONFIG_I2O_EXT_ADAPTEC_DMA64=y > # CONFIG_I2O_CONFIG is not set > # CONFIG_I2O_BUS is not set > # CONFIG_I2O_BLOCK is not set > # CONFIG_I2O_SCSI is not set > # CONFIG_I2O_PROC is not set # CONFIG_NET_SB1000 is not set | CONFIG_NET_SB1000=m # CONFIG_HP100 is not set | CONFIG_HP100=m # CONFIG_ATP is not set | CONFIG_ATP=m # CONFIG_DE600 is not set | CONFIG_DE600=m # CONFIG_DE620 is not set | CONFIG_DE620=m # CONFIG_HAMACHI is not set | CONFIG_HAMACHI=m # CONFIG_YELLOWFIN is not set | CONFIG_YELLOWFIN=m # CONFIG_ATM_LANAI is not set | CONFIG_ATM_LANAI=m # CONFIG_ATM_ENI is not set | CONFIG_ATM_ENI=m # CONFIG_ATM_FIRESTREAM is not set | # CONFIG_ATM_ENI_DEBUG is not set # CONFIG_ATM_ZATM is not set | CONFIG_ATM_ENI_TUNE_BURST=y # CONFIG_ATM_IDT77252 is not set | # CONFIG_ATM_ENI_BURST_TX_16W is not set # CONFIG_ATM_AMBASSADOR is not set | CONFIG_ATM_ENI_BURST_TX_8W=y # CONFIG_ATM_HORIZON is not set | CONFIG_ATM_ENI_BURST_TX_4W=y # CONFIG_ATM_IA is not set | CONFIG_ATM_ENI_BURST_TX_2W=y # CONFIG_ATM_FORE200E is not set | CONFIG_ATM_ENI_BURST_RX_16W=y # CONFIG_ATM_HE is not set | CONFIG_ATM_ENI_BURST_RX_8W=y # CONFIG_ATM_SOLOS is not set | CONFIG_ATM_ENI_BURST_RX_4W=y > CONFIG_ATM_ENI_BURST_RX_2W=y > CONFIG_ATM_FIRESTREAM=m > CONFIG_ATM_ZATM=m > # CONFIG_ATM_ZATM_DEBUG is not set > CONFIG_ATM_IDT77252=m > # CONFIG_ATM_IDT77252_DEBUG is not set > CONFIG_ATM_IDT77252_RCV_ALL=y > CONFIG_ATM_IDT77252_USE_SUNI=y > CONFIG_ATM_AMBASSADOR=m > # CONFIG_ATM_AMBASSADOR_DEBUG is not set > CONFIG_ATM_HORIZON=m > # CONFIG_ATM_HORIZON_DEBUG is not set > CONFIG_ATM_IA=m > # CONFIG_ATM_IA_DEBUG is not set > CONFIG_ATM_FORE200E=m > CONFIG_ATM_FORE200E_USE_TASKLET=y > CONFIG_ATM_FORE200E_TX_RETRY=16 > CONFIG_ATM_FORE200E_DEBUG=0 > CONFIG_ATM_HE=m > CONFIG_ATM_HE_USE_SUNI=y > CONFIG_ATM_SOLOS=m # CONFIG_DEFXX is not set | CONFIG_DEFXX=m # CONFIG_SKFP is not set | CONFIG_DEFXX_MMIO=y > CONFIG_SKFP=m # CONFIG_LOGITECH_FF is not set | CONFIG_LOGITECH_FF=y # CONFIG_REISERFS_FS is not set | CONFIG_REISERFS_FS=m # CONFIG_JFS_FS is not set | # CONFIG_REISERFS_CHECK is not set > # CONFIG_REISERFS_PROC_INFO is not set > CONFIG_REISERFS_FS_XATTR=y > CONFIG_REISERFS_FS_POSIX_ACL=y > CONFIG_REISERFS_FS_SECURITY=y > CONFIG_JFS_FS=m > CONFIG_JFS_POSIX_ACL=y > CONFIG_JFS_SECURITY=y > # CONFIG_JFS_DEBUG is not set > # CONFIG_JFS_STATISTICS is not set # CONFIG_SECURITY_PATH is not set | CONFIG_SECURITY_PATH=y # CONFIG_SECURITY_TOMOYO is not set | CONFIG_SECURITY_TOMOYO=y
此指令只顯示內核設定的不同之處。其它分別包括修正錯誤的修正檔(來自 CentOS 錯誤追踪器),直至這些修正檔獲上游整合(屆時它們便再沒必要存在,並會從 plus 內核中被刪除)。要查考那些錯誤獲修正及那些功能被啟用的最簡單方法就是檢閱 changelog。請留意你可選擇採用源碼或已編譯的 rpm。
$ rpm -qp --changelog kernel-2.6.32-573.3.1.el6.centos.plus.src.rpm | more * Thu Aug 13 2015 Akemi Yagi <toracat@centos.org> [2.6.32-573.3.1.el6.centos.plus] - Roll in CentOS Branding - Added new config files for i686 and x86_64 with extra features turned on including some network adapters, some ATM, all serial ATA, Adaptec I2O, ARPD, BusLogic, IPX, Appletalk, ReiserFS, JFS, TOMOYO - Added a fix to compile the jfs module [bug#5453] - Added a fix for race in TOMOYO [bug#5378] - Added a fix for usermodehelper [bug#5588] - Added a patch that allows non-LogiTech remote to work [bug#5780] - Added sysfs-fix-printk-warnings-bug6157.patch [bug#6157] - Added fs-tmpfs-add-xattrs-support.patch [bug#4586.18700] - Added fix-fadvise-for-tmpfs.patch [bug#6938] - DEBUG_KMEMLEAK enabled in config [bug#7055] - Added support for Kontron [bug#7270] - Disable BRIDGE_IGMP_SNOOPING [bug#7796] then enable it as of 504.23.4 [bug#8862] - Enable IRDA (regression) [bug#8070] - Added a patch to fix redefine error in reiserfs
5. 總結
使用 CentOSPlus 軟件庫比使用其他 CentOS 軟件庫更為危險,因為它容許有多個更新的套件,而且並不是為整體啟用而設計的。
你可應用 CentOSPlus 內的所有套件,但一般的做法是單單選擇所需的套件,然後透過 exclude= 及 includepkgs=(或 exclude= 及 yum-plugin-priorities 插件) 從 CentOSPlus 軟件庫內下載這些套件。
請確定你理解這裡的所有概念,然後才啟用 CentOSPlus 軟件庫。
Translation of revision 37