We are trying to update few yum packages but need to ensure that the packages which need to reboot are to be excluded. Example : There are close to 500-1000 packages and I need to exclude kernel packages as we cannot update without security approval. Is there any option in yum to handle this scenario?
RHEL and derivatives have
needs-restarting in the
yum-utils package, but that can only give you an after-the-fact evaluation. However, it is a python script, so we can peek inside to find the following hard-coded list of packages that will make it suggest a reboot:
# For which package updates we should recommend a reboot # Taken from https://access.redhat.com/solutions/27943 REBOOTPKGS = ['kernel', 'glibc', 'linux-firmware', 'systemd', 'udev', 'openssl-libs', 'gnutls', 'dbus']
Note that this list might not be exhaustive. I'd need to double-check if RedHat recommends to their paying and supported customers to restart according to this heuristic when doing unattended updates, that would give me a bit more confidence.
Exclude a package from update : Edit
/etc/yum.conf → add one or more "exclude" lines. https://tecadmin.net/exclude-packages-from-yum-update/
Note : The wildcard ( * ) is important.