All Products
Search
Document Center

Alibaba Cloud Linux:Upgrade or downgrade the kernel version of Alibaba Cloud Linux 3

Last Updated:Sep 23, 2024

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

Warning

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

kernel

The kernel package is a metadata package that does not contain files. The package only ensures that the subpackages of the package can be correctly installed. The package includes the following subpackages:

  • kernel-core: contains the binary image (vmlinuz) of the Linux kernel and the fundamental kernel modules required for core functionality, including modules required for proper running of the hardware.

  • kernel-modules: contains modules that are not included in the kernel-core subpackage.

  • kernel-modules-intrenal: contains specific uncommon network drivers.

  • kernel-modules-extra: contains the drivers of uncommon hardware as well as unpopular network scheduling policies and algorithms.

kernel-devel

The package is used to build kernel header files and the corresponding Makefiles for kernel modules.

kernel-headers

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.

kernel-tools

The package contains tools for Linux kernel management.

perf

The perf tool is used to monitor the performance of the Linux kernel.

bpftool

The bpf tool is used to check and manage the Berkeley Packet Filter (BPF) system.

kernel-debug

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.

kernel-debug-devel

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

  1. View the current version of the kernel.

    uname -r
  2. Check whether updates are available for the kernel.

    sudo yum check-update kernel
    • If updates are available for the kernel, perform the following steps:

      1. 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-tool

        Enter y to confirm the information and press the Enter key to complete the installation.

      2. Restart the system for the new kernel version to take effect.

        sudo reboot
      3. View 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

  1. View the current version and all available versions of the kernel.

    sudo yum list kernel --showduplicates
  2. Upgrade 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 y to confirm the information and press the Enter key to complete the installation.

  3. Restart the system for the new kernel version to take effect.

    sudo reboot
  4. View 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.

  1. View the current version and all available versions of the kernel.

    sudo yum list kernel --showduplicates
  2. Downgrade 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 y to confirm the information and press the Enter key to complete the installation.

  3. Restart the system for the new kernel version to take effect.

    sudo reboot
  4. View the current version of the kernel.

    uname -r