AAtsushi's Blog
Infrastructure

Red Hat Kernel Upgrade

→ 日本語版を読む

The kernel is the core part of the Linux OS that acts as an intermediary (interface) between hardware and software applications.

In Red Hat, the kernel is packaged in RPM format and can be easily upgraded with yum (or dnf).

The kernel RPM package consists of subpackages as follows:

$ sudo rpm -qa | grep kernel
kernel-tools-libs-5.14.0-383.el9.x86_64
kernel-modules-core-5.14.0-383.el9.x86_64
kernel-core-5.14.0-383.el9.x86_64
kernel-modules-5.14.0-383.el9.x86_64
kernel-5.14.0-383.el9.x86_64
kernel-tools-5.14.0-383.el9.x86_64

Use the yum repoquery command to display a list of versions for each subpackage.

$ yum repoquery kernel-core
Last metadata expiration check: 1:09:25 ago on Fri 01 Dec 2023 11:55:35 AM UTC.
kernel-core-0:5.14.0-378.el9.x86_64
kernel-core-0:5.14.0-381.el9.x86_64
kernel-core-0:5.14.0-383.el9.x86_64
kernel-core-0:5.14.0-386.el9.x86_64
kernel-core-0:5.14.0-388.el9.x86_64

You can also check files inside a package with yum repoquery -l.

$ yum repoquery -l kernel-core-0:5.14.0-388.el9.x86_64
Last metadata expiration check: 1:13:28 ago on Fri 01 Dec 2023 11:55:35 AM UTC.
/boot/.vmlinuz-5.14.0-388.el9.x86_64.hmac
/boot/System.map-5.14.0-388.el9.x86_64
/boot/config-5.14.0-388.el9.x86_64
/boot/initramfs-5.14.0-388.el9.x86_64.img
/boot/symvers-5.14.0-388.el9.x86_64.gz
/boot/vmlinuz-5.14.0-388.el9.x86_64
/lib/modules/5.14.0-388.el9.x86_64/.vmlinuz.hmac
/lib/modules/5.14.0-388.el9.x86_64/System.map
/lib/modules/5.14.0-388.el9.x86_64/config
/lib/modules/5.14.0-388.el9.x86_64/modules.builtin
/lib/modules/5.14.0-388.el9.x86_64/modules.builtin.modinfo
/lib/modules/5.14.0-388.el9.x86_64/symvers.gz
/lib/modules/5.14.0-388.el9.x86_64/vmlinuz
/usr/share/licenses/kernel-core
/usr/share/licenses/kernel-core/COPYING-5.14.0-388.el9

Use yum check-update to check whether there are updatable modules.

$ yum check-update kernel-core

Last metadata expiration check: 1:07:06 ago on Fri 01 Dec 2023 11:55:35 AM UTC.

kernel-core.x86_64                                         5.14.0-388.el9                                         baseos

Check the current kernel version with uname -r.

$ uname -r
5.14.0-383.el9.x86_64

To install a kernel subpackage, simply use yum install.

# yum install kernel-core-0:5.14.0-388.el9
Last metadata expiration check: 0:49:12 ago on Fri 01 Dec 2023 12:23:39 PM UTC.
Dependencies resolved.
========================================================================================================================
 Package                             Architecture           Version                        Repository              Size
========================================================================================================================
Installing dependencies:
 kernel-core                         x86_64                 5.14.0-388.el9                 baseos                  20 M
 kernel-modules-core                 x86_64                 5.14.0-388.el9                 baseos                  32 M

Transaction Summary
========================================================================================================================
Install  2 Packages

Total download size: 53 M
Installed size: 89 M
Is this ok [y/N]: y
Downloading Packages:
(1/2): kernel-core-5.14.0-388.el9.x86_64.rpm                                            5.0 MB/s |  20 MB     00:04
(2/2): kernel-modules-core-5.14.0-388.el9.x86_64.rpm                                    5.0 MB/s |  32 MB     00:06
----------------------------------------------------------------------------------------------------------------