What command should I use as the root user to update the system kernel from the command line? Print

  • yum, kernel, update, dnf, server, kernal, rpm, uname, elrepo, repository
  • 140

1. Update Package Metadata

Always refresh the repository cache first:

 
dnf clean all dnf makecache

2. Update All Packages (Including Kernel)

The simplest way is:

 
dnf update -y

This pulls in the latest kernel available in the AlmaLinux repositories, along with other packages.


3. (Optional) Install the Latest Kernel Explicitly

If you only want to update the kernel:

 
dnf install -y kernel kernel-core kernel-modules

4. Verify Installed Kernels

List all installed kernels:

 
rpm -q kernel

5. Reboot Into the New Kernel

After the update, reboot:

 
reboot

6. Confirm the Running Kernel

After reboot, check your active kernel version:

 
uname -r

???? Pro Tip:

  • AlmaLinux normally installs new kernels side-by-side (doesn’t overwrite the old one).

  • The GRUB bootloader lets you choose between them if something breaks.

  • If you want the absolutely latest mainline kernels (not just the stable AlmaLinux ones), you’d enable the ELRepo repository and install from there.


Was this answer helpful?

« Back