Ce contenu n'est pas disponible dans la langue sélectionnée.
Chapter 1. The Linux kernel
The Red Hat kernel RPM package provides the Linux kernel. You must keep the kernel updated to ensure your system has the latest bug fixes, performance enhancements, patches, and hardware compatibility.
1.1. What the kernel is Copier lienLien copié sur presse-papiers!
The kernel is a core part of a Linux operating system that manages the system resources and provides an interface between hardware and software applications.
The Red Hat kernel is a custom-built kernel based on the upstream Linux mainline kernel that Red Hat engineers further develop and harden with a focus on stability and compatibility with the latest technologies and hardware.
The Red Hat kernels are packaged in the RPM format to upgrade and verify by the DNF package manager.
Red Hat only supports kernels that are compiled by Red Hat.
1.2. RPM packages Copier lienLien copié sur presse-papiers!
An RPM package consists of an archive of files and metadata used to install and erase these files on Red Hat Enterprise Linux (RHEL).
Specifically, the RPM package contains the following parts:
GPG signature
The GPG signature is used to verify the integrity of the package.
Header (package metadata)
The RPM package manager uses this metadata to determine package dependencies, where to install files, and other information.
Payload
The payload is a
cpioarchive that contains files to install to the system.
There are two types of RPM packages. Both types share the file format and tooling, but have different contents and serve different purposes:
Source RPM (SRPM)
An SRPM contains source code and a
specfile, which describes how to build the source code into a binary RPM. Optionally, the SRPM can contain patches to source code.Binary RPM
A binary RPM contains the binaries built from the sources and patches.
1.3. The Linux kernel RPM package overview Copier lienLien copié sur presse-papiers!
The kernel RPM is a meta package that does not contain any files, but rather ensures that all required subpackages are properly installed.
The following list includes required packages:
kernel-core-
Provides the binary image of the Linux kernel (
vmlinuz). kernel-modules-core- Provides the basic kernel modules to ensure core functionality. This includes the modules essential for the proper functioning of the most commonly used hardware.
kernel-modules-
Provides the remaining kernel modules that are not present in
kernel-modules-core.
The kernel-core and kernel-modules-core subpackages together can be used in virtualized and cloud environments to provide a RHEL 10 kernel with a quick boot time and a small disk size footprint. kernel-modules subpackage is usually unnecessary for such deployments.
Optional kernel packages are for example:
kernel-modules-extra- Provides kernel modules for uncommonly used kernel modules. Loading of the modules in this package is disabled by default.
kernel-debug- Provides a kernel with many debugging options enabled for kernel diagnosis, at the expense of reduced performance.
kernel-tools- Provides tools for manipulating the Linux kernel and supporting documentation.
kernel-devel-
Provides the kernel headers and makefiles that are enough to build modules against the
kernelpackage. kernel-abi-stablelists-
Provides information pertaining to the RHEL kernel ABI, including a list of kernel symbols required by external Linux kernel modules and a
dnfplugin to aid enforcement. kernel-headers- Includes the C header files that specify the interface between the Linux kernel and user-space libraries and programs. The header files define structures and constants required for building most standard programs.
kernel-uki-virtContains the Unified Kernel Image (UKI) of the RHEL kernel.
UKI combines the Linux kernel,
initramfs(initial RAM file system), and the kernel command line into a single signed binary which can be booted directly from the UEFI firmware.kernel-uki-virtcontains the required kernel modules to run in virtualized and cloud environments and can be used instead of thekernel-coresubpackage.
1.4. Displaying contents of a kernel package Copier lienLien copié sur presse-papiers!
To check if a kernel package provides a specific file, such as a module, query the repository. You can display the file list without downloading or installing the package.
Use the dnf utility to query the file list, for example, of the kernel-core, kernel-modules-core, or kernel-modules package. Note that the kernel package is a meta package that does not contain any files.
Procedure
List the available versions of a package:
$ dnf repoquery <package_name>Display the list of files in a package:
$ dnf repoquery -l <package_name>
1.5. Installing specific kernel versions Copier lienLien copié sur presse-papiers!
You can install new kernels by using the DNF package manager.
Procedure
To install a specific kernel version, enter the following command:
# dnf install kernel-<version>
1.6. Updating the kernel Copier lienLien copié sur presse-papiers!
You can update the kernel by using the DNF package manager.
Procedure
To update the kernel, enter the following command:
# dnf upgrade kernelThis command updates the kernel along with all dependencies to the latest available version.
Reboot your system for the changes to take effect.
See the
dnf(8)man page on your system for more information.
1.7. Setting a kernel as default Copier lienLien copié sur presse-papiers!
To set a specific kernel as the default, use the grubby command-line tool and GRUB configuration.
Procedure
Setting the kernel as default by using the
grubbytool.Enter the following command to set the kernel as default using the
grubbytool:# grubby --set-default $kernel_path
Setting the kernel as default by using the
versionargument.List the boot entries using the kernel keyword and then set an intended kernel as default:
# select k in /boot/vmlinuz-*; do grubby --set-default=$k; break; doneNoteTo list the boot entries using the
titleargument, enter# grubby --info=ALL | grep title.
Setting the default kernel for only the next boot.
Enter the following command to set the default kernel for only the next reboot using the
grub2-rebootcommand:# grub2-reboot <index|title|id>WarningSet the default kernel for only the next boot with care. Installing new kernel RPMs, self-built kernels, and manually adding the entries to the
/boot/loader/entries/directory might change the index values.