CentOSPlus 软件库

1. CentOSPlus 软件库是什么?

CentOSPlus 软件库藏有针对 CentOS base 及 CentOS updates 软件库内的组件的更新。这些更新组件并不属于上游的发行,所以在扩展 CentOS 的功能同时牺牲了与上游的兼容性。启用这个软件库会导致 CentOS 与上游有差别。你应该明白这样做的后果才启用 CentOSPlus。你可以浏览我们镜像中针对 CentOS 6CentOS 7CentOS 8 的 CentOSPlus 目录来寻找要使用的结构。

ArtWork/WikiDesign/icon-admonition-info.png

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-centos5
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

zh/AdditionalResources/Repositories/CentOSPlus (last edited 2020-10-03 12:50:10 by TimothyLee)