第 6 章 软件管理
6.1. YUM 的主要变化
在 Red Hat Enterprise Linux(RHEL)8 中,新的 YUM 工具可保证安装软件,该工具基于 DNF 技术 (YUM v4)。
6.1.1. YUM v4 与 YUM v3 相比的优点
yum v4 比 RHEL 7 上之前使用的 YUM v3 有以下优点:
- 提高性能
- 支持模块化内容
- 设计良好的稳定 API,用于与工具集成
如需了解有关新 YUM v4 工具和 RHEL 7 中上一版本 YUM v3 之间的不同的详细信息,请参阅 DNF CLI 与 YUM 相比的变化。
6.1.2. 如何使用 YUM v4
安装软件
yum v4 在使用命令行、编辑或者创建配置文件时与 YUM v3 兼容。
要安装软件,您可以使用 yum
命令及其具体选项,方式与在 RHEL 7 中相同。
请参阅 yum 安装软件 的更多详细信息。
插件可用性
旧的 YUM v3 插件与 YUM v4 的新版本不兼容。一些 yum 插件和工具已移植到新的 DNF 后端,并可使用与 RHEL 7 中的相同名称安装。它们也提供兼容性符号链接,因此可在通常的位置找到 二 进制文件、配置文件和目录。
如果插件不再包括,或者其替换的组件无法满足原来的要求,请联系红帽支持以请求功能增强。请参阅 如何打开和管理客户门户网站中的支持问题单所述?
如需更多信息,请参阅 插件界面。
API 的可用性
请注意,YUM v3 提供的旧版本的 Python API 不再可用。建议用户将其插件和脚本迁移到 YUM v4 (DNF Python API)所提供的新 API 中,该 API 稳定且完全支持。上游项目记录了新的 DNF Python API - 请参见 DNF API 参考。
Libdnf 和 Hawkey API(包括 C 和 Python)都被认为是不稳定的,在 RHEL 8 生命周期中可能会有变化。
6.1.3. YUM 配置文件选项可用性
本节总结了在 RHEL 7 和 RHEL 8 之间 /etc/yum.conf
和 /etc/yum.repos.d/*.repo
文件的配置文件选项的更改。
表 6.1. /etc/yum.conf 文件配置文件选项的更改
RHEL 7 选项 | RHEL 8 状态 |
---|---|
alwaysprompt | 删除 |
assumeno | 可用 |
assumeyes | 可用 |
autocheck_running_kernel | 可用 |
autosavets | 删除 |
bandwidth | 可用 |
bugtracker_url | 可用 |
cachedir | 可用 |
check_config_file_age | 可用 |
clean_requirements_on_remove | 可用 |
color | 可用 |
color_list_available_downgrade | 可用 |
color_list_available_install | 可用 |
color_list_available_reinstall | 可用 |
color_list_available_running_kernel | 删除 |
color_list_available_upgrade | 可用 |
color_list_installed_extra | 可用 |
color_list_installed_newer | 可用 |
color_list_installed_older | 可用 |
color_list_installed_reinstall | 可用 |
color_list_installed_running_kernel | 删除 |
color_search_match | 可用 |
color_update_installed | 可用 |
color_update_local | 可用 |
color_update_remote | 可用 |
命令 | 删除 |
config_file_path | 可用 |
debuglevel | 可用 |
deltarpm | 可用 |
deltarpm_metadata_percentage | 删除 |
deltarpm_percentage | 可用 |
depsolve_loop_limit | 删除 |
disable_excludes | 可用 |
diskspacecheck | 可用 |
distroverpkg | 删除 |
enable_group_conditionals | 删除 |
errorlevel | 可用 |
exactarchlist | 删除 |
exclude | 可用 |
exit_on_lock | 可用 |
fssnap_abort_on_errors | 删除 |
fssnap_automatic_keep | 删除 |
fssnap_automatic_post | 删除 |
fssnap_automatic_pre | 删除 |
fssnap_devices | 删除 |
fssnap_percentage | 删除 |
ftp_disable_epsv | 删除 |
gpgcheck | 可用 |
group_command | 删除 |
group_package_types | 可用 |
groupremove_leaf_only | 删除 |
history_list_view | 可用 |
history_record | 可用 |
history_record_packages | 可用 |
http_caching | 删除 |
Include | 删除 |
installonly_limit | 可用 |
installonlypkgs | 可用 |
installrootkeep | 删除 |
ip_resolve | 可用 |
keepalive | 删除 |
keepcache | 可用 |
kernelpkgnames | 删除 |
loadts_ignoremissing | 删除 |
loadts_ignorenewrpm | 删除 |
loadts_ignorerpm | 删除 |
localpkg_gpgcheck | 可用 |
logfile | 删除 |
max_connections | 删除 |
mddownloadpolicy | 删除 |
mdpolicy | 删除 |
metadata_expire | 可用 |
metadata_expire_filter | 删除 |
minrate | 可用 |
mirrorlist_expire | 删除 |
multilib_policy | 可用 |
obsoletes | 可用 |
override_install_langs | 删除 |
overwrite_groups | 删除 |
password | 可用 |
payload_gpgcheck | 删除 |
persistdir | 可用 |
pluginconfpath | 可用 |
pluginpath | 可用 |
plugins | 可用 |
protected_multilib | 删除 |
protected_packages | 可用 |
proxy | 可用 |
proxy_password | 可用 |
proxy_username | 可用 |
query_install_excludes | 删除 |
recent | 可用 |
recheck_installed_requires | 删除 |
remove_leaf_only | 删除 |
repo_gpgcheck | 可用 |
repopkgsremove_leaf_only | 删除 |
reposdir | 可用 |
reset_nice | 可用 |
retries | 可用 |
rpmverbosity | 可用 |
shell_exit_status | 删除 |
showdupesfromrepos | 可用 |
skip_broken | 可用 |
skip_missing_names_on_install | 删除 |
skip_missing_names_on_update | 删除 |
ssl_check_cert_permissions | 删除 |
sslcacert | 可用 |
sslclientcert | 可用 |
sslclientkey | 可用 |
sslverify | 可用 |
syslog_device | 删除 |
syslog_facility | 删除 |
syslog_ident | 删除 |
throttle | 可用 |
timeout | 可用 |
tolerant | 删除 |
tsflags | 可用 |
ui_repoid_vars | 删除 |
upgrade_group_objects_upgrade | 可用 |
upgrade_requirements_on_install | 删除 |
usercache | 删除 |
username | 可用 |
usr_w_check | 删除 |
表 6.2. /etc/yum.repos.d/*.repo 文件配置文件选项更改
RHEL 7 选项 | RHEL 8 状态 |
---|---|
async | 删除 |
bandwidth | 可用 |
baseurl | 可用 |
compare_providers_priority | 删除 |
cost | 可用 |
deltarpm_metadata_percentage | 删除 |
deltarpm_percentage | 可用 |
enabled | 可用 |
enablegroups | 可用 |
exclude | 可用 |
failovermethod | 删除 |
ftp_disable_epsv | 删除 |
gpgcakey | 删除 |
gpgcheck | 可用 |
gpgkey | 可用 |
http_caching | 删除 |
includepkgs | 可用 |
ip_resolve | 可用 |
keepalive | 删除 |
metadata_expire | 可用 |
metadata_expire_filter | 删除 |
metalink | 可用 |
mirrorlist | 可用 |
mirrorlist_expire | 删除 |
name | 可用 |
password | 可用 |
proxy | 可用 |
proxy_password | 可用 |
proxy_username | 可用 |
repo_gpgcheck | 可用 |
repositoryid | 删除 |
retries | 可用 |
skip_if_unavailable | 可用 |
ssl_check_cert_permissions | 删除 |
sslcacert | 可用 |
sslclientcert | 可用 |
sslclientkey | 可用 |
sslverify | 可用 |
throttle | 可用 |
timeout | 可用 |
ui_repoid_vars | 删除 |
username | 可用 |
6.1.4. yum v4 特性行为不同
YUM v3 的一些特性在 YUM v4 中可能有所不同。如果此类更改对您的工作流有影响,请向红帽支持创建一个问题单,请参阅 如何打开和管理客户门户网站中的支持问题单所述?
6.1.4.1. yum list 显示重复条目
当使用 yum list
命令列出软件包时,可能会显示重复的条目,每个库都有同名和版本的软件包。
这是有意设计的,它允许用户在需要时区分这些软件包。
例如: 如果在 repo1 和 repo2 中使用 package-1.2,则 YUM v4 将打印这两个实例:
[…] package-1.2 repo1 package-1.2 repo2 […]
相反,传统的 YUM v3 命令过滤掉这样的重复内容,因此只显示一个实例:
[…] package-1.2 repo1 […]
6.1.5. 事务历史记录文件的更改
这部分总结了 RHEL 7 和 RHEL 8 之间的事务历史记录文件更改。
在 RHEL 7 中, 使用 /var/log/yum.log
文件存储:
- 安装、更新和删除软件包的注册表
- Yum 和 PackageKit 中的事务
在 RHEL 8 中,没有直接对应的 /var/log/yum.log
文件。要显示事务信息,包括 PackageKit 和 microdnf,使用 yum history
命令。
另外,您可以搜索 /var/log/dnf.rpm.log
文件,但这个日志文件不包含 PackageKit 和 microdnf 的事务,它有一个日志轮转功能来定期删除存储信息。
为了尽快向用户提供最新的信息,本文档可能会包括由机器自动从英文原文翻译的内容。如需更多信息,请参阅此说明。