Rocky Linux 9

Prev Next

Available in VPC

Caution

(As of December 31, 2024)
A compatibility issue with NAVER Cloud Platform products occurred in the Rocky Linux 9 OS 9.4 kernel (5.14.0-427.xx.1.el9_4.x86_64), but was resolved in the 9.5 kernel (5.14.0-503.xx.1.el9_5.x86_64) with the restoration of some features.
If you are using the Rocky Linux 9.4 OS, update to the 9.5 kernel or higher.
The January 16, 2025 regular deployment will include an upgrade of the Rocky Linux 9.4 BaseOS kernel to version 9.5.

This guide describes how to update a kernel on the Rocky Linux 9 server of NAVER Cloud Platform.

This guide is written based on new servers created on NAVER Cloud Platform, so there might be differences from the user server environment. User server environments may be affected by kernel updates and server restarts due to various reasons such as security hardening tasks and other setting tasks. Therefore, be familiar with the following before you perform a kernel update:

  • Create a replicated server using Server image before updating a kernel of the actual server. Perform the kernel update on the replicated server and check if it restarts successfully. When switching to operational status after restarting, check for any issues in the server. Perform the kernel update only after thorough validation to ensure there are no issues.
  • In the case of GPU servers, the GPU driver that matches the kernel version must be installed for normal operation. If the updated kernel is incompatible with GPU drivers, the GPU server might not function normally. Therefore, check GPU driver compatibility before you perform kernel updates. For related information, see GPU driver guide.
Note

This kernel update guide will no longer provide regular updates moving forward. Therefore, when checking for the latest information or installing a different kernel version, see the relevant guide and take the necessary steps.
The kernel version specified in the guide serves as an example, so make sure to thoroughly test other kernel versions as needed before installation.

Caution
  • The user is solely responsible for performing kernel updates on their server, and NAVER Cloud Platform will not be held responsible for any issues caused by these updates.
  • Normal server usage might be unavailable during kernel updates and restarts, and recovery from this issue is not supported. In addition, server recovery is not supported when the kernel update fails.
  • Before updating the kernel, make sure to keep the backup created through Server image until it is no longer needed.
  • No separate support is provided for problems related to this guide.

Check kernel versions available for update

To check the kernel versions available for update on a Rocky Linux 9 server:

By default, http://repo.ncloud.com, the NCP repo is set as the base URL. In environments with a public IP or a private subnet configured with NAT, you can switch the repository to an external public mirror site instead of the NCP repo.

Note

NCP repo is a repository provided by NAVER Cloud Platform to support user environments like VPC private subnets where external access is limited.
Since NCP repo synchronizes only 4 times a year, it is recommended to switch to an external public mirror site to apply the latest patches promptly. For more information, see Linux OS repository configuration checklist guide.

  1. Access the server you want to apply the kernel update to remotely.
  2. Check the kernel version to apply to the server.
    [root@kvm-rockylinux94 ~]# dnf --showduplicates list kernel
    Installed Packages
    kernel.x86_64                                                                                5.14.0-427.13.1.el9_4                                                                                @System
    kernel.x86_64                                                                                5.14.0-427.37.1.el9_4                                                                                @System
    Available Packages
    kernel.x86_64                                                                                5.14.0-503.19.1.el9_5                                                                                baseos
    

Update kernel

To update kernels for Rocky Linux 9 servers:

Note

This guide provides an example of upgrading the kernel version to 5.14.0-503.19.1.el9_5 on a Rocky Linux 9 server.
The kernel versions available for installation at the time of referencing the guide may vary, so thoroughly test other versions before installation.

  1. Access the server you want to apply the kernel update to remotely.

  2. Check the kernel version of the server.

    [root@kvm-rockylinux94 ~]# uname -r
    5.14.0-427.37.1.el9_4.x86_64
    
  3. Check the repository information connected to the server.
    If you need to edit the Repo file, see Linux OS repository configuration checklist guide to edit the repository information.

    [root@kvm-rockylinux94 ~]# grep -e ^mirrorlist -e ^baseurl /etc/yum.repos.d/rocky{,-extras}.repo
    /etc/yum.repos.d/rocky.repo:baseurl=http://repo.ncloud.com/rocky/$releasever/BaseOS/$basearch/os/
    /etc/yum.repos.d/rocky.repo:baseurl=http://repo.ncloud.com/rocky/$releasever/BaseOS/$basearch/debug/tree/
    /etc/yum.repos.d/rocky.repo:baseurl=http://repo.ncloud.com/rocky/$releasever/BaseOS/source/tree/
    /etc/yum.repos.d/rocky.repo:baseurl=http://repo.ncloud.com/rocky/$releasever/AppStream/$basearch/os/
    /etc/yum.repos.d/rocky.repo:baseurl=http://repo.ncloud.com/rocky/$releasever/AppStream/$basearch/debug/tree/
    /etc/yum.repos.d/rocky.repo:baseurl=http://repo.ncloud.com/rocky/$releasever/AppStream/source/tree/
    /etc/yum.repos.d/rocky.repo:baseurl=http://repo.ncloud.com/rocky/$releasever/CRB/$basearch/os/
    /etc/yum.repos.d/rocky.repo:baseurl=http://repo.ncloud.com/rocky/$releasever/CRB/$basearch/debug/tree/
    /etc/yum.repos.d/rocky.repo:baseurl=http://repo.ncloud.com/rocky/$releasever/CRB/source/tree/
    /etc/yum.repos.d/rocky-extras.repo:baseurl=http://repo.ncloud.com/rocky/$releasever/extras/$basearch/os/
    /etc/yum.repos.d/rocky-extras.repo:baseurl=http://repo.ncloud.com/rocky/$releasever/extras/$basearch/debug/tree/
    /etc/yum.repos.d/rocky-extras.repo:baseurl=http://repo.ncloud.com/rocky/$releasever/extras/source/tree/
    /etc/yum.repos.d/rocky-extras.repo:baseurl=http://repo.ncloud.com/rocky/$releasever/plus/$basearch/os/
    /etc/yum.repos.d/rocky-extras.repo:baseurl=http://repo.ncloud.com/rocky/$releasever/plus/$basearch/debug/tree/
    /etc/yum.repos.d/rocky-extras.repo:baseurl=http://repo.ncloud.com/rocky/$releasever/plus/source/tree/
    
  4. Check the kernel version provided by the repository.

    [root@kvm-rockylinux94 ~]# rm -rf /var/cache/dnf/*
    
    [root@kvm-rockylinux94 ~]# dnf list kernel-5.14.0-503.19.1.el9_5
    Available Packages
    kernel.x86_64                                                                                5.14.0-503.19.1.el9_5                                                                                 baseos
    
  5. Install the viewed version of the kernel.
    Carefully review the list of packages being newly installed, updated, or removed. If everything is in order, enter y to complete the installation.

    [root@kvm-rockylinux94 ~]# dnf install kernel-5.14.0-503.19.1.el9_5
    Dependencies resolved.
    =========================================================================================================================================================================================================
     Package                                               Architecture                             Version                                                   Repository                                Size
    =========================================================================================================================================================================================================
    Installing:
     kernel                                                x86_64                                   5.14.0-503.19.1.el9_5                                     baseos                                   2.0 M
     kernel-core                                           x86_64                                   5.14.0-503.19.1.el9_5                                     baseos                                    18 M
     kernel-modules                                        x86_64                                   5.14.0-503.19.1.el9_5                                     baseos                                    36 M
     kernel-modules-core                                   x86_64                                   5.14.0-503.19.1.el9_5                                     baseos                                    30 M
    
    Transaction Summary
    =========================================================================================================================================================================================================
    Install  4 Packages
    
    Total download size: 86 M
    Installed size: 126 M
    Is this ok [y/N]: y
    (Check the installed packages, updated packages, and deleted packages carefully, and proceed with y if there are no abnormalities)
    
    ... Omitted ...
    
    Installed:
      kernel-5.14.0-503.19.1.el9_5.x86_64        kernel-core-5.14.0-503.19.1.el9_5.x86_64        kernel-modules-5.14.0-503.19.1.el9_5.x86_64        kernel-modules-core-5.14.0-503.19.1.el9_5.x86_64
    
    Complete!
    
  6. After the installation is complete, check the bootable kernel version and the default boot kernel version.

     [root@kvm-rockylinux94 ~]# grep BLSCFG /etc/default/grub
     GRUB_ENABLE_BLSCFG=true
    
     [root@kvm-rockylinux94 ~]# grubby --info=ALL | grep ^kernel
     kernel="/boot/vmlinuz-5.14.0-503.19.1.el9_5.x86_64"
     kernel="/boot/vmlinuz-5.14.0-427.37.1.el9_4.x86_64"
     kernel="/boot/vmlinuz-5.14.0-427.13.1.el9_4.x86_64"
     kernel="/boot/vmlinuz-0-rescue-289a2c19141142dbb2e193b5796efac0"
    
     [root@kvm-rockylinux94 ~]# grubby --default-kernel
     /boot/vmlinuz-5.14.0-503.19.1.el9_5.x86_64
    
  7. (Optional) If the default boot kernel version is different from the installed kernel version, change the default boot kernel.

    [root@kvm-rockylinux94 ~]# grubby --info=ALL | grep ^kernel
    kernel="/boot/vmlinuz-5.14.0-503.19.1.el9_5.x86_64"
    kernel="/boot/vmlinuz-5.14.0-427.37.1.el9_4.x86_64"
    kernel="/boot/vmlinuz-5.14.0-427.13.1.el9_4.x86_64"
    kernel="/boot/vmlinuz-0-rescue-289a2c19141142dbb2e193b5796efac0"
    
    [root@kvm-rockylinux94 ~]# grubby --set-default="/boot/vmlinuz-5.14.0-503.19.1.el9_5.x86_64"
    The default is /boot/loader/entries/289a2c19141142dbb2e193b5796efac0-5.14.0-503.19.1.el9_5.x86_64.conf with index 0 and kernel /boot/vmlinuz-5.14.0-503.19.1.el9_5.x86_64
    
    [root@kvm-rockylinux94 ~]# grubby --default-kernel
    /boot/vmlinuz-5.14.0-503.19.1.el9_5.x86_64
    
  8. Reboot the server to activate the latest kernel version.

    [root@kvm-rockylinux94 ~]# sync;reboot
    
    Note

    If the server reboot fails, it means the kernel update was not successfully applied. In this case, see Restore kernel update to revert to the previous kernel version.

  9. Log in to the server again and check if the new kernel is activated.

    [root@kvm-rockylinux94 ~]# uname -r
    5.14.0-503.19.1.el9_5.x86_64
    
    Note

    To check if the updated kernel is properly applied, see Check kernel update to check the kernel installation status.

Check kernel update

To check if the kernel update was successfully applied:

  1. Access the server remotely.
  2. Check if the kernel package is installed.
    [root@kvm-rockylinux94 ~]# rpm -qa | grep kernel-5.14.0-503.19.1.el9_5.x86_64
    kernel-5.14.0-503.19.1.el9_5.x86_64
    
  3. Check if the initramfs file and vmlinuz file are created in the /boot directory.
    Note

    The /boot/initramfs-.x86_64kdump.img file may not be created depending on your settings.

    [root@kvm-rockylinux94 ~]# ls -l /boot/initramfs-5.14.0-503.19.1.el9_5.x86_64.img
    -rw------- 1 root root 33534200 Dec 31 15:15 /boot/initramfs-5.14.0-503.19.1.el9_5.x86_64.img
    
    [root@kvm-rockylinux94 ~]# ls -l /boot/initramfs-5.14.0-503.19.1.el9_5.x86_64kdump.img
    -rw------- 1 root root 31055360 Dec 31 15:18 /boot/initramfs-5.14.0-503.19.1.el9_5.x86_64kdump.img
    
    [root@kvm-rockylinux94 ~]# ls -l /boot/vmlinuz-5.14.0-503.19.1.el9_5.x86_64
    -rwxr-xr-x 1 root root 14461768 Dec 19 22:07 /boot/vmlinuz-5.14.0-503.19.1.el9_5.x86_64
    
  4. Check if the latest kernel settings are registered.
    [root@kvm-rockylinux94 ~]# grubby --info=ALL | grep ^kernel
    kernel="/boot/vmlinuz-5.14.0-503.19.1.el9_5.x86_64"
    kernel="/boot/vmlinuz-5.14.0-427.37.1.el9_4.x86_64"
    kernel="/boot/vmlinuz-5.14.0-427.13.1.el9_4.x86_64"
    kernel="/boot/vmlinuz-0-rescue-289a2c19141142dbb2e193b5796efac0"
    
    [root@kvm-rockylinux94 ~]# ls -l /boot/loader/entries
    total 16
    -rw-r--r--. 1 root root 453 Oct  4 09:46 289a2c19141142dbb2e193b5796efac0-0-rescue.conf
    -rw-r--r--  1 root root 429 Dec 31 15:15 289a2c19141142dbb2e193b5796efac0-5.14.0-427.13.1.el9_4.x86_64.conf
    -rw-r--r--  1 root root 429 Dec 31 15:15 289a2c19141142dbb2e193b5796efac0-5.14.0-427.37.1.el9_4.x86_64.conf
    -rw-r--r--  1 root root 456 Dec 31 15:15 289a2c19141142dbb2e193b5796efac0-5.14.0-503.19.1.el9_5.x86_64.conf
    
  5. Check the grub settings.
    [root@kvm-rockylinux94 ~]# grep GRUB_DEFAULT /etc/default/grub
    GRUB_DEFAULT=saved
    
    [root@kvm-rockylinux94 ~]# cat /boot/grub2/grubenv
    # GRUB Environment Block
    # WARNING: Do not edit this file by tools other than grub-editenv!!!
    saved_entry=289a2c19141142dbb2e193b5796efac0-5.14.0-503.19.1.el9_5.x86_64
    menu_auto_hide=1
    boot_success=0
    boot_indeterminate=0
    ... Omitted ...
    
    [root@kvm-rockylinux94 ~]# grubby --default-kernel
    /boot/vmlinuz-5.14.0-503.19.1.el9_5.x86_64
    

Restore kernel update

If the server fails to restart properly after a kernel update, you must revert to the previous kernel before the update. You can revert it to one of the many installed kernel versions, and this guide describes how to revert the kernel to the version immediately before the update.

Note

To resolve server restart issues, you can attempt server recovery by entering the Single Mode. For more information on how to run reboot in the Single Mode, see Server recovery guide.

  1. From the NAVER Cloud Platform console's VPC environment, navigate to i_menu > Services > Compute > Server.

  2. Click the Server menu.

  3. Select the server to recover from the server list, and click [Server connection console].

  4. Select the previous version as the booting kernel from the grub booting page and reboot.

    • KVM RockyLinux 9 grub booting interface
      kernel-update-kvm-rocky9_console01
  5. After booting is complete, check the kernel version of the server.

    [root@kvm-rockylinux94 ~]# uname -r
    5.14.0-427.37.1.el9_4.x86_64
    
  6. Check the kernel version that is currently active.

    [root@kvm-rockylinux94 ~]# grubby --default-kernel
    /boot/vmlinuz-5.14.0-503.19.1.el9_5.x86_64
    
    [root@kvm-rockylinux94 ~]# grubby --info=ALL | grep ^kernel
    kernel="/boot/vmlinuz-5.14.0-503.19.1.el9_5.x86_64"
    kernel="/boot/vmlinuz-5.14.0-427.37.1.el9_4.x86_64"
    kernel="/boot/vmlinuz-5.14.0-427.13.1.el9_4.x86_64"
    kernel="/boot/vmlinuz-0-rescue-289a2c19141142dbb2e193b5796efac0"
    
  7. Reset the default kernel version to the previous kernel version when booting.

    [root@kvm-rockylinux94 ~]# grubby --set-default="/boot/vmlinuz-5.14.0-427.37.1.el9_4.x86_64"
    The default is /boot/loader/entries/289a2c19141142dbb2e193b5796efac0-5.14.0-427.37.1.el9_4.x86_64.conf with index 1 and kernel /boot/vmlinuz-5.14.0-427.37.1.el9_4.x86_64
    
    [root@kvm-rockylinux94 ~]# grubby --default-kernel
    /boot/vmlinuz-5.14.0-427.37.1.el9_4.x86_64
    
  8. (Optional) Reboot the server to check whether the server boots up normally with the updated kernel version.

    [root@kvm-rockylinux94 ~]# sync;reboot
    
  9. (Optional) Log back into the server to check the booting status and the kernel version.

    [root@kvm-rockylinux94 ~]# uname -r
    5.14.0-427.37.1.el9_4.x86_64
    

Troubleshoot repository related issues during kernel update

In case of repository issues during a kernel update, see Linux OS Repository configuration checklist guide FAQ.