Upgrading the kernel on your CentOS Stream release 9 system is a crucial step to ensure your system’s security, stability, and performance. The following guide provides a comprehensive set of commands to upgrade the kernel without any additional comments or unnecessary data. Copy and paste the following commands into your terminal to execute the upgrade.
Prerequisites ✅
Ensure you:
- Are logged in as a user with
sudo
privileges. - Have a backup of important data.
- Understand the risks involved in upgrading the kernel.
Upgrade Steps 👨💻
Step 1: Check Your Current Kernel Version
uname -r
Step 2: Enable ELRepo Repository
sudo rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
sudo dnf install https://www.elrepo.org/elrepo-release-9.el9.elrepo.noarch.rpm
Step 3: Install the New Kernel
Option 1: Install the Latest Mainline Kernel
sudo dnf --disablerepo="*" --enablerepo="elrepo-kernel" list available
sudo dnf --enablerepo=elrepo-kernel install kernel-ml
Option 2: Install the Latest Long-Term Support Kernel
sudo dnf --disablerepo="*" --enablerepo="elrepo-kernel" list available | grep lt
sudo dnf --enablerepo=elrepo-kernel install kernel-lt
Step 4: Update the GRUB Configuration
sudo grubby --default-kernel
sudo grubby --set-default /boot/vmlinuz-{your_kernel_version}
Step 5: Reboot and Verify
sudo reboot
After rebooting:
uname -r
Final Checks 🔍
- Check that all services are running as expected.
- Monitor the system for any unusual behavior.
Congratulations! 🎉 You have successfully upgraded your CentOS Stream release 9 kernel to the latest version.