Ce contenu n'est pas disponible dans la langue sélectionnée.
Chapter 2. Installing security updates
In RHEL, you can install a specific security advisory and all available security updates. You can also configure the system to download and install security updates automatically.
2.1. Installing all available security updates Copier lienLien copié sur presse-papiers!
To keep the security of your system up to date, you can install all currently available security updates using the yum utility.
Prerequisites
- A Red Hat subscription is attached to the host.
Procedure
Install security updates using
yumutility:yum update --security
# yum update --securityCopy to Clipboard Copied! Toggle word wrap Toggle overflow Without the
--securityparameter,yum updateinstalls all updates, including bug fixes and enhancements.Confirm and start the installation by pressing y:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Optional: List processes that require a manual restart of the system after installing the updated packages:
yum needs-restarting
# yum needs-restarting 1107 : /usr/sbin/rsyslogd -n 1199 : -bashCopy to Clipboard Copied! Toggle word wrap Toggle overflow The previous command lists only processes that require a restart, and not services. That is, you cannot restart processes listed using the
systemctlutility. For example, thebashprocess in the output is terminated when the user that owns this process logs out.
2.2. Installing a security update provided by a specific advisory Copier lienLien copié sur presse-papiers!
In certain situations, you might want to install only specific updates. For example, if a specific service can be updated without scheduling a downtime, you can install security updates for only this service, and install the remaining security updates later.
Prerequisites
- A Red Hat subscription is attached to the host.
You know the ID of the security advisory that you want to update.
For more information, see the Identifying the security advisory updates section.
Procedure
Install a specific advisory, for example:
yum update --advisory=RHSA-2019:0997
# yum update --advisory=RHSA-2019:0997Copy to Clipboard Copied! Toggle word wrap Toggle overflow Alternatively, update to apply a specific advisory with a minimal version change by using the
yum upgrade-minimalcommand, for example:yum upgrade-minimal --advisory=RHSA-2019:0997
# yum upgrade-minimal --advisory=RHSA-2019:0997Copy to Clipboard Copied! Toggle word wrap Toggle overflow Confirm and start the installation by pressing
y:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Optional: List the processes that require a manual restart of the system after installing the updated packages:
yum needs-restarting
# yum needs-restarting 1107 : /usr/sbin/rsyslogd -n 1199 : -bashCopy to Clipboard Copied! Toggle word wrap Toggle overflow The previous command lists only processes that require a restart, and not services. This means that you cannot restart all processes listed by using the
systemctlutility. For example, thebashprocess in the output is terminated when the user that owns this process logs out.
2.3. Installing security updates automatically Copier lienLien copié sur presse-papiers!
You can configure your system so that it automatically downloads and installs all security updates.
Prerequisites
- A Red Hat subscription is attached to the host.
-
The
dnf-automaticpackage is installed.
Procedure
In the
/etc/dnf/automatic.conffile, in the[commands]section, make sure theupgrade_typeoption is set to eitherdefaultorsecurity:[commands] # What kind of upgrade to perform: # default = all available upgrades # security = only the security upgrades upgrade_type = security
[commands] # What kind of upgrade to perform: # default = all available upgrades # security = only the security upgrades upgrade_type = securityCopy to Clipboard Copied! Toggle word wrap Toggle overflow Enable and start the
systemdtimer unit:systemctl enable --now dnf-automatic-install.timer
# systemctl enable --now dnf-automatic-install.timerCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
Verify that the timer is enabled:
systemctl status dnf-automatic-install.timer
# systemctl status dnf-automatic-install.timerCopy to Clipboard Copied! Toggle word wrap Toggle overflow