This document describes a safe and reliable procedure for updating a RHEL system within the same major version.
Determine the Target Release
Decide on your target RHEL release number (e.g., 9.6). See RHEL Downloads and look up the appropriate kernel version in, for example, Packages—v9.
update-kernel.sh: For systems without kernel-devel, updating within the same release (e.g., 9.5→9.5)update-kernel-withdevel.sh: For systems with kernel-devel, updating within the same releaseupdate-kernel-withrel.sh: For systems without kernel-devel, updating across different releases (e.g., 9.5→9.6)update-kernel-withdevel-withrel.sh: For systems with kernel-devel, updating across releasesEdit the releasever= variable (only present in scripts without -withrel) and the newkernelver= variable at the top of the script as appropriate.
-l option to list current kernel-related packages. For example:
./update-kernel-withdevel-withrel.sh -l
dnf clean all
rm -rf /var/cache/dnf
dnf --disableexcludes=main makecache
cd /work/rhel9
./update-kernel-withdevel-withrel.sh
dnf update
If any *.rpmsave or *.rpmnew files are created during update, review and merge changes as needed. To find these files:
find / -regex '.*/.*\.rpm\(save\|new\)'
systemctl reboot
Or use your preferred method.
uname -a
cat /etc/os-release
# or
cat /etc/redhat-release
-l option again to confirm package versions:
./update-kernel-withdevel-withrel.sh -l
dnf update
dnf repoquery --unsatisfied
👉 Browse these files on GitHub Web
| Use Case | Script Name |
|---|---|
| No kernel-devel, same release | update-kernel.sh |
| With kernel-devel, same release | update-kernel-withdevel.sh |
| No kernel-devel, across releases | update-kernel-withrel.sh |
| With kernel-devel, across releases | update-kernel-withdevel-withrel.sh |
This procedure leverages the -l (list-only) script option for before/after verification of kernel package versions, and provides all commands for a consistent, reliable RHEL minor release update.