Show Table of Contents
32.5. 软件包选择
警告
可以在 kickstart 文件的
%packages 部分通过指定 *,安装所有可用软件包。Red Hat 不支持此类安装。
在以前的 Red Hat Enterprise Linux 版本里,这个功能是由
@Everything 提供的,但 Red Hat Enterprise Linux 6 中不包括这个选项。
在 kickstart 文件中使用
%packages 命令列出要安装的软件包(仅用于全新安装,升级安装时不支持软件包命令)。
可根据组群或者单独的软件包名称指定软件包。安装程序定义一些包含相关软件包的组群。组群列表请参考 Red Hat Enterprise Linux 6 DVD 中的
variant/repodata/comps-*.xml 文件。每个组群都有一个 id、用户可见值、名称、描述和软件包列表。在软件包列表中,如果选择了该组群,则会安装标记为 mandatory 的软件包。如果选择了该组群,则会默认选择标记为 default 的软件包,而标记为 optional 的软件包则必须特别指定选择,即使已经选择要安装该组群。
指定组,每个条目一行,以
@ 符号开始,接着是空格,然后是完整的组名或 comps.xml 里指定的组 ID。例如:
%packages @X Window System @Desktop @Sound and Video
请注意
Core 和 Base 组总是默认被选择,所以并不需要在 %packages 部分指定它们。
警告
使用
@Core 组织性最小安装时,不会再安装的系统中配置防火墙(iptables/ip6tables)。为解决这个问题,请按如下所述在软件包选择中添加 authconfig 和 system-config-firewall-base软件包。如果有这些软件包则会正确配置防火墙。
最小安装的
%packages 部分还会配置防火墙,类似如下:
%packages @Core authconfig system-config-firewall-base
详情请查看 Red Hat 客户门户网站。
通过名字指定单个的软件包,每个条目对应一行。可以在条目里使用星号作为通配符来对应软件包的名称。例如:
sqlite curl aspell docbook*
docbook* 条目包含 docbook-dtds、docbook-simple、docbook-slides 和其他匹配这个通配符模式的软件包。
使用前横杠指定安装中不使用的软件包或组。例如:
-@ Graphical Internet -autofs -ipa*fonts
重要
--disablewinbindusedefaultdomain — 将 winbind 配置为假设在其用户名中没有域的用户不是域用户。
glibc.i686
使用 kickstart 文件通过指定
* 可引起在安装的系统中的软件包和文件冲突。将已知可造成此问题的软件包分配到 @Conflicts(variant) 组中,其中 variant 是 Client、ComputeNode、Server 或 Workstation。如果在 kickstart 文件中指定 *,请确定排除 @Conflicts(variant),否则安装将失败:
* -@Conflicts (Server)
注:Red Hat 不支持在 kickstart 文件中使用
*,即使不包括 @Conflicts(variant) 也不支持。
这部分必须以
%end 命令结尾。
%packages 命令也支持下面的选项:
--nobase- 不要安装 @Base 组。使用这个选项执行最小安装,例如:安装单一目的服务器或者桌面装置。
--nocore- Disables installation of the
@Corepackage group which is otherwise always installed by default. Disabling the@Corepackage group should be only used for creating lightweight containers; installing a desktop or server system with--nocorewill result in an unusable system.注意
Using-@Coreto exclude packages in the@Corepackage group does not work. The only way to exclude the@Corepackage group is with the--nocoreoption. --resolvedeps- --resolvedeps 选项已经被取消了。目前依赖关系可以自动地被解析。
--ignoredeps- --ignoredeps 选项已经被取消了。当前依赖关系可以自动地被解析。
--ignoremissing- 忽略缺少的软件包或软件包组,而不是暂停安装来向用户询问是中止还是继续安装。例如:
%packages --ignoremissing

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.