Rocky Linux 10 Tutorial / Security updates, kernel reboot checks and fallback boot
Security updates in Rocky Linux 10 should be applied after checking the security advisories and change plans provided by DNF, and after a standard package-based kernel update, a reboot is required to verify the actual running version. The indication that the package is installed, the default kernel for the next boot, and the currently running kernel are different states.
Prepare the change scope and recovery path first
The kernel is the core of the operating system that manages hardware, memory, processes, and more. Even if a new kernel package is installed, the currently running kernel does not immediately change to the new files. In a typical kernel update, it is necessary to boot into the new kernel and then check that services and actual work are functioning normally.
The source lab used a dedicated VirtualBox VM with Rocky Linux 10.2, DNF 4.20.0 and dnf-plugins-core 4.7.0. It had already completed the initial full update and boot into the new kernel. This lesson separately examines advisory filters, reboot decisions and a one-time boot of the previous kernel.
- Prepare independent backups and a management console for recovery. If the server only allows SSH access, first check how to access the console if the connection is lost after a reboot.
- Check the running tasks, users, and service downtime. For files or database operations that need to be saved, follow the shutdown and recovery procedures of the respective service.
- Record the current kernel, installed kernels, and the default boot path. Keep the previously stable kernel and boot entries.
- Check the active repositories and update paths for additional packages. This query cannot assess packages available only from disabled sources.
If you need a VM restore point, also consider the difference between a powered-off snapshot and an independent backup. Neither a snapshot nor booting an older kernel necessarily reverses every change in databases or external storage.
Check the latest metadata and security notices.
First, check the latest list of active repositories. The exit status of check-update can be misinterpreted if simply divided into general success or failure.
dnf repolist --enabled
sudo dnf --refresh check-update
printf 'check-update exit=%s\n' "$?"
| Exit Status | Meaning in check-update |
|---|---|
0 |
No applicable updates in the queried range |
100 |
There are update candidates. Do not treat this value itself as a download failure. |
| Other error states | Check previous error messages such as network, metadata, or locks. |
Security notices and package candidates can be queried as follows. Notice metadata is information used to determine which issue is fixed by which package release.
dnf updateinfo summary
dnf updateinfo list --security --available
Description of Rocky's Errata distinguishes security notices as RLSA, bug fix notices as RLBA, and feature improvement notices as RLEA. If a notice ID appears in the output, check both that notice and the corresponding package version and scope of application. At the source lab’s recorded query, its enabled default repositories offered no additional updates and check-update returned 0.
An empty list does not prove that there are no known security issues. It means that, based on the current active repository, metadata, and installation status, there are no applicable candidates. The security status of external repositories, directly installed programs, or container images should be checked according to the respective source and operational method.
Read security updates and kernel updates plans separately.
First, check the update plan to which the security notice applies. --security is an option to select target packages based on security-related notice metadata. Because it may include other changes due to dependency resolution, review the full list.
sudo dnf --assumeno upgrade --security
If the content to be applied and the suspension/recovery plan are correct, recheck and approve the plan using a command without --assumeno.
sudo dnf upgrade --security
When checking the plan for kernel packages, you can use the following command. Kernel-targeted updates do not replace all security updates of the operating system.
sudo dnf --assumeno upgrade kernel
After reviewing the new kernel and dependent packages, space, and the previous kernel to be preserved, run sudo dnf upgrade kernel when actually applying it. If a policy requires a full update, separately review the scope of sudo dnf upgrade. Record in the work log which scope was applied between the security filter and the full update.
The security and kernel preview of this VM were all Nothing to do.. This was not recorded as if a new security update had been installed. The previous actual kernel installation was completed in Chapter 5, and in this practice, the boot states of the two kernels already installed are compared. The details of DNF options and shutdown states can be confirmed in DNF official command reference .
Compare the installed kernel, the running kernel, and the default kernel.
rpm -q kernel-core
uname -r
sudo grubby --default-kernel
sudo grubby --info=ALL | grep -E '^(index|kernel|title)='
rpm -q shows the packages installed on the disk, uname -r shows the currently running kernel, and grubby --default-kernel is the path for the boot kernel to be selected by default. If there is a one-time boot designation or another selection from the console, the default path and the actually running version may be different.
| Items checked in the practice. | Value |
|---|---|
| Previously installed kernel-core | 6.12.0-211.16.1.el10_2.0.1.x86_64 |
| Installed new kernel-core | 6.12.0-211.74.1.el10_2.x86_64 |
| Initial running kernel | 6.12.0-211.74.1.el10_2.x86_64 |
| Default boot path | /boot/vmlinuz-6.12.0-211.74.1.el10_2.x86_64 |
Check your own version through the actual output. Do not judge whether security patches are applied based solely on the beginning of the version string; instead, compare it with the modified packages provided in the distribution release and security announcements. The distribution may reflect fixes in the same kernel series.
Use the reboot recommendation along with a comparison of the running versions
After an update, you can use needs-restarting as a supplementary tool to check files and processes in use. It is provided by dnf-plugins-core in DNF 4, and if the command is not available, first check whether the plugin is installed.
sudo dnf needs-restarting -r
printf 'reboot hint exit=%s\n' "$?"
Official description of needs-restarting indicates that 1 in -r advises a reboot is necessary, while 0 indicates a reboot is not needed. Determine separately whether a non-zero value arose due to a runtime error along with the preceding messages. If a service-specific judgment is required, also check the results in sudo dnf needs-restarting -s and the operational procedures for the respective service.
An exit code of 0 does not prove that the newest installed kernel is running. In the source lab, the tool reported no reboot requirement even while an older installed kernel was running. Recommendations for checking whether the core packages have been updated after boot, and whether the administrator selected the latest installed kernel, are separate questions; therefore, uname -r and the default boot path should be compared separately.
Once the necessary data saving and service interruption preparations are complete, reboot. It is expected that the SSH connection will be disconnected, but you must also verify that it can reconnect for the task to be considered complete.
sudo systemctl reboot
After booting, check the kernel, management path, and service failures.
uname -r
sudo grubby --default-kernel
systemctl --failed
systemctl is-active sshd
getenforce
Actual business services and data access should also be included in the server's verification checklist. Simply confirming that SSH on a general server is normal does not mean that web, database, or backup operations have all been verified.
Practice booting with a previous kernel from the recovery console.
If booting with the new kernel fails, you can select a previously installed kernel from the bootloader GRUB to secure the management path. GRUB (GNU GRand Unified Bootloader) selects the kernel before the operating system starts. Rocky's kernel boot problem guide also explains selecting a previous kernel. After temporary recovery, investigate the cause and reassess the required security patch status.
Enter the initial GRUB menu on reboot from the console, check the full version of the previous kernel, and then select that entry. If the menu is hidden, check whether it can be displayed by pressing the Esc key during boot, and practice the VM console and actual bootloader configuration in advance. Do not prepare this procedure after deleting the kernel you want to recover.
On a VM that is normally connected, you can also try selecting a different kernel just once. The titles below are the previous entries actually installed on this VM; on another computer, replace them with the exact titles there. If there is another one-time boot reservation, do not overwrite it.
sudo grubby --info=ALL | grep -E '^(index|kernel|title)='
sudo grubby --default-kernel
sudo grub2-editenv list | grep '^next_entry='
If there is no reserved entry or the value is empty like next_entry=, specify it after confirming that the following title exactly exists in the current list. Enclose it in quotes to preserve the title and spaces.
sudo grub2-reboot 'Rocky Linux (6.12.0-211.16.1.el10_2.0.1.x86_64) 10.2 (Red Quartz)'
sudo grub2-editenv list | grep '^next_entry='
sudo systemctl reboot
The description of next_entry in GNU GRUB explains that this value is used only for the next boot, is cleared after use, and must be writable to the environment block at runtime. Numeric indexes may change when adding a new kernel, so do not reuse numbers from old operation records without checking.
In the source lab, login succeeded using the previous 6.12.0-211.16.1.el10_2.0.1.x86_64 and checked SSH, sudo, and SELinux Enforcing. The default kernel path remained as the new 6.12.0-211.74.1.el10_2.x86_64, and the temporary value was cleared to next_entry=. It is necessary to distinguish between items with names remaining and reserved values remaining.
In the source Windows/VirtualBox lab, the initial console did not change for a while, and the SSH banner wait timed out. After sending the normal shutdown signal and continuously checking the status, the login screen was reached and a successful connection confirmed boot completion without forced initialization. We do not assume that the guest is ready to log in simply because the command finished or the VM is running.
After confirming that the temporary value was cleared and the default path matched the intended new kernel, we reboot normally again to compare the default boot behavior. If the new kernel continues to fail in an actual failure, we first secure the item that works normally on the console and a recovery plan before repeating the same failure.
During the source lab’s second reboot, the guest returned to the new 6.12.0-211.74.1.el10_2.x86_64, and the default path and running version matched again. No temporary reserved values remained, zero systemd units failed, SSH was active, and SELinux was Enforcing. The previous kernel package was also preserved. This is the result of testing boot selection with two normal kernel versions and is not a test that caused an actual kernel panic.
Set the criteria for preserving previous kernels and completing updates.
Unlike normal packages, where a new version immediately replaces the old version, kernels can keep multiple versions. Check the installonly settings of DNF and the available space in the system’s /boot filesystem.
dnf config-manager --dump | grep -E '^installonly_limit =|^installonlypkgs ='
df -h /boot
rpm -q kernel-core
The installonly_limit of this VM was 3, and in reality, two versions of kernel-core were installed. Do not assume that the number 3 reflects the current state on all computers. Clearing old kernels should be reviewed separately after verifying the new kernel and services as well as recovery possibilities, and you should not carelessly remove the running kernel or the only valid recovery option.
Record completion details separately for the applied security, full, and kernel update scope, installation results, the actual booted version, and service verification results. Distinguish between cases where there were no update candidates and cases where new packages were installed. If temporarily recovered to a previous kernel, verify again whether it has reached the corrected state required by the security notice.




