The kernel of Alibaba Cloud Linux 3 is packaged in Red Hat Package Manager (RPM) format, which facilitates you to obtain and change the kernel version by using the Yellowdog Updater Modified (YUM) package manager. This topic describes how to use yum commands to change the kernel version to meet your business requirements in specific scenarios.
Limits
Operating system: Alibaba Cloud Linux 3
Kernel upgrades and downgrades may cause compatibility and stability issues. We recommend that you familiarize yourself with kernel features and exercise caution when you upgrade and downgrade the kernel.
Kernel packages
The following table describes the kernel packages included in Alibaba Cloud Linux 3.
kernel package | Description |
| The
|
| The package is used to build kernel header files and the corresponding Makefiles for kernel modules. |
| The package contains C header files that specify the interface between the Linux kernel and userspace libraries and programs. You can use the C header files to define the structures and constants that are required to build majority standard applications. |
| The package contains tools for Linux kernel management. |
| The |
| The |
| A kernel in which a large number of debugging options are enabled. The kernel is used for system debugging and diagnostics. The performance of the kernel cannot be guaranteed. |
| The package is used to build kernel header files and the corresponding Makefiles for kernel modules. |
Upgrade the kernel
In most cases, a new kernel version is released to fix bugs and Common Vulnerabilities and Exposures (CVEs) and add new features. We recommend that you understand the updates in a kernel version and upgrade to the kernel version based on your business requirements.
Upgrade the kernel to the latest version
View the current version of the kernel.
uname -rCheck whether updates are available for the kernel.
sudo yum check-update kernelIf updates are available for the kernel, perform the following steps:
Upgrade the kernel and the related kernel tools to the latest version.
sudo yum update kernel kernel-modules kernel-modules-extra kernel-modules-internal kernel-devel kernel-headers kernel-tools perf bpf-toolEnter
yto confirm the information and press theEnterkey to complete the installation.Restart the system for the new kernel version to take effect.
sudo rebootView the current version of the kernel.
uname -r
If no updates are available, you do not need to upgrade the kernel.
Upgrade the kernel to a specific version
View the current version and all available versions of the kernel.
sudo yum list kernel --showduplicatesUpgrade the kernel and the related kernel tools to a specific version.
Replace the value of the
<New kernel version>parameter with the version number to which you want to upgrade the kernel. Example:5.10.134-15.al8.kver=<New kernel version> && sudo yum update kernel-${kver} kernel-devel-${kver} kernel-modules-${kver} kernel-modules-extra-${kver} kernel-modules-internal-${kver} kernel-headers-${kver} kernel-tools-${kver} perf-${kver} bpftool-${kver}Enter
yto confirm the information and press theEnterkey to complete the installation.Restart the system for the new kernel version to take effect.
sudo rebootView the current version of the kernel.
uname -r
Downgrade the kernel to a specific version
If you want to use an earlier kernel version to meet specific application requirements, we recommend that you familiarize yourself with the kernel content and downgrade the kernel to the earlier version based on your business requirements. For example, if compatibility issues occur between the current kernel version and the software that you use, you can downgrade to an earlier version.
View the current version and all available versions of the kernel.
sudo yum list kernel --showduplicatesDowngrade the kernel and the related kernel tools to a specific version.
Replace the value of the
<New kernel version>parameter with the version number to which you want to downgrade the kernel. Example:5.10.134-15.al8.kver=<New kernel version> && sudo yum downgrade kernel-${kver} kernel-devel-${kver} kernel-headers-${kver} kernel-modules-${kver} kernel-modules-extra-${kver} kernel-modules-internal-${kver} kernel-tools-${kver} perf-${kver} bpftool-${kver}Enter
yto confirm the information and press theEnterkey to complete the installation.Restart the system for the new kernel version to take effect.
sudo rebootView the current version of the kernel.
uname -r