Upgrade or downgrade the kernel version of Alibaba Cloud Linux 3

更新时间:
复制 MD 格式

The Alibaba Cloud Linux 3 kernel is packaged in Red Hat Package Manager (RPM) format. You can upgrade or downgrade the kernel version using the YUM (Yellowdog Updater Modified) package manager to fix bugs, address Common Vulnerabilities and Exposures (CVEs), add new features, or resolve application compatibility issues.

Warning

Kernel upgrades and downgrades can cause compatibility and stability issues. Review the kernel release notes before proceeding and test on a non-production instance first.

Supported operating system

Alibaba Cloud Linux 3

Kernel packages

Alibaba Cloud Linux 3 includes the following kernel packages:

kernel : A metadata package that contains no files. It ensures that all subpackages are installed correctly. Subpackages:

  • kernel-core: Contains the binary image (vmlinuz) and the fundamental kernel modules required for core functionality, including hardware support.

  • kernel-modules: Contains kernel modules not included in kernel-core.

  • kernel-modules-internal: Contains specific uncommon network drivers.

  • kernel-modules-extra: Contains drivers for uncommon hardware and unpopular network scheduling policies and algorithms.

kernel-devel : Used to build kernel header files and the corresponding Makefiles for kernel modules.

kernel-headers : Contains C header files that define the interface between the Linux kernel and userspace libraries and programs. These headers define the structures and constants needed to build most standard applications.

kernel-tools : Contains tools for Linux kernel management.

perf : Used to monitor Linux kernel performance.

bpftool : Used to inspect and manage the Berkeley Packet Filter (BPF) system.

kernel-debug : A kernel with many debugging options enabled, for use in system debugging and diagnostics. Performance is not guaranteed.

kernel-debug-devel : Used to build kernel header files and the corresponding Makefiles for kernel modules.

Upgrade the kernel

New kernel versions fix bugs and CVEs, and add new features. Review the release notes for a version before upgrading to it.

Upgrade to the latest version

  1. Check the current kernel version.

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

    sudo yum check-update kernel
    • If updates are available, continue to the next step.

    • If no updates are available, no action is required.

  3. Upgrade the kernel and all related packages 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

    When prompted, enter y to confirm.

  4. Restart the system for the new kernel to take effect.

    sudo reboot
  5. Verify that the system is running the new kernel.

    uname -r

Upgrade to a specific version

  1. List all available kernel versions.

    sudo yum list kernel --showduplicates
  2. Upgrade the kernel and related packages to a specific version. Replace <kernel-version> with the target version, for example, 5.10.134-15.al8.

    kver=<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}

    When prompted, enter y to confirm.

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

    sudo reboot
  4. Verify that the system is running the correct kernel version.

    uname -r

Downgrade the kernel

Downgrade the kernel when the current version causes compatibility issues with your applications or drivers.

  1. List all available kernel versions.

    sudo yum list kernel --showduplicates
  2. Downgrade the kernel and related packages to a specific version. Replace <kernel-version> with the target version, for example, 5.10.134-15.al8.

    kver=<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}

    When prompted, enter y to confirm.

  3. Restart the system for the downgraded kernel to take effect.

    sudo reboot
  4. Verify that the system is running the correct kernel version.

    uname -r