Red Hat Training

A Red Hat training course is available for RHEL 8

2.3. 自动安装安全更新

使用以下流程,使用安全更新自动更新您的系统。

先决条件

  • 附加到主机的红帽订阅。

流程

  1. 使用 yum 安装 dnf-automatic

    # yum install dnf-automatic
  2. 按 y 确认并开始安装:

    ...
    Transaction Summary
    ===========================================
    Upgrade  ... Packages
    Total download size: ... M
    Is this ok [y/d/N]: y
  3. 在您选择的文本编辑器中打开 /etc/dnf/automatic.conf 文件,例如:

    # vi /etc/dnf/automatic.conf
  4. [commands] 部分中配置 upgrade_type = security 选项:

    [commands]
    #  What kind of upgrade to perform:
    # default                            = all available upgrades
    # security                           = only the security upgrades
    upgrade_type = security
  5. 启用 systemd 计时器单元
# systemctl enable --now dnf-automatic-install.timer

其他资源

  • dnf-automatic(8) 手册页