How To Install A Specific Kernel Version Or Downgrade The Kernel

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux

Issue

  • How do I downgrade the kernel?
  • How do I install a specific kernel version

Resolution

The system can be booted to a prior kernel version. If the target kernel version is not installed, the appropriate packages will need to be installed and the system rebooted. Once installed, by default, the newly installed kernel will be the default kernel to boot into. If the target kernel is already installed on the system, please refer to the following knowledgebase article on changing the default kernel;

Via YUM/DNF

Red Hat Enterprise Linux 8 and Above

# dnf install kernel-<VERSION>

For example;

# dnf install kernel-4.18.0-553.44.1.el8_10

To help identify the specific name of a kernel package to downgrade to, DNF can list all the versiosn of a packages, both installed and available for installation;

# dnf search kernel --showduplicates

For example;

Updating Subscription Management repositories.
======================== Name & Summary Matched: kernel ========================
kernel-4.18.0-553.72.1.el8_10.x86_64 : The Linux kernel, based on version 4.18.0, heavily modified with backports
kernel-4.18.0-553.77.1.el8_10.x86_64 : The Linux kernel, based on version 4.18.0, heavily modified with backports
kernel-4.18.0-553.80.1.el8_10.x86_64 : The Linux kernel, based on version 4.18.0, heavily modified with backports
kernel-4.18.0-80.el8.x86_64 : The Linux kernel
kernel-4.18.0-80.1.2.el8_0.x86_64 : The Linux kernel
...

Red Hat Enterprise Linux 7 and below

# yum install kernel-<VERSION>

For example,

# yum install kernel-3.10.0-1160.119.1.el7

To help identify the specific name of a kernel package to downgrade to, YUM can list all the versiosn of a packages, both installed and available for installation;

# yum list kernel --show-duplicates

For example

# yum list kernel --show-duplicates
Loaded plugins: product-id, search-disabled-repos, subscription-manager
Installed Packages
kernel.x86_64             3.10.0-1160.el7                    @anaconda/7.9      
kernel.x86_64             3.10.0-1160.118.1.el7              @rhel-7-server-rpms
Available Packages
kernel.x86_64             3.10.0-123.el7                     rhel-7-server-rpms 
kernel.x86_64             3.10.0-123.1.2.el7                 rhel-7-server-rpms 
...

Installing Individual Packages

If installing the kernel packages, for example, outside of a YUM/DNF repository, RPM can be used to install the target kernel. However, which necessary kernel packages change based on the release of Red Hat Enterprise Linux. For details on installing a package via RPM, please refer to the following knowledgebase article;

Red Hat Enterprise Linux 9 and above

At minimum, the kernel, kernel-core, kernel-modules, and kernel-modules-core of the same version are required. For example; kernel-5.14.0-570.37.1.el9_6, kernel-core-5.14.0-570.37.1.el9_6, kernel-modules-5.14.0-570.37.1.el9_6, and kernel-modules-core-5.14.0-570.37.1.el9_6.

Red Hat Enterprise Linux 8

At minimum, the kernel, kernel-core, and kernel-modules packages of the same kernel version arenecessary. For example; kernel-4.18.0-553.44.1.el8_10, kernel-core-4.18.0-553.44.1.el8_10, and kernel-modules-4.18.0-553.44.1.el8_10.

Red Hat Enterprise Linux 7

Only the kernel package is necessary

Root Cause

The main kernel package providing kernel functionality is quite modular and independent of other packages on the system. As such, most any core kernel packages can be installed even from outside of Red Hat. The modularity is particularly useful for testing new features in upstream, for example, with the ELN kernel.

However, tertiary kernel packages, such as kernel-cross-headers, kernel-headers, kernel-tools, kernel-tools-libs, etc may be dependent on other package versions like glibc.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments