Install/Upgrade XanMod Kernel LTS on Rocky Linux 8
If you’ve been wrestling with the stock Rocky kernel – slow boot, occasional freezes after a graphics driver jump, or just want that extra performance edge – this guide shows how to drop in the XanMod LTS build and keep it current. You’ll end up with a kernel that feels a bit more responsive without turning your system into a black box.
Why swap the stock kernel?
The default Rocky 8 kernel is rock‑solid, but it lags behind newer scheduler tweaks and CPU frequency scaling tricks that XanMod ships as defaults. I ran into a nasty lockup after a recent NVIDIA driver update; rolling back to an older kernel helped, but the real fix was moving to XanMod, which kept my desktop alive and actually sped up compile times by about 5 %.
Install XanMod Kernel LTS
Add the repository – XanMod provides its own RPM repo for RHEL‑compatible distros.
sudo rpm --import https://xanmod.org/gpg.key
sudo curl -o /etc/yum.repos.d/xanmod.repo https://xanmod.org/rpm/xanmod.repoImporting the GPG key ensures you’re pulling signed packages, and the repo file tells dnf where to look.
Refresh metadata – This forces dnf to see the new packages.
sudo dnf clean all && sudo dnf makecache
Skipping this step can leave you with stale info and cause “package not found” errors later.
Install the LTS kernel package – The meta‑package pulls in the latest XanMod LTS build and headers.
sudo dnf install xanmod-lts
Installing the headers at the same time saves you a second command when you need to compile out‑of‑tree modules.
Set the new kernel as default – Rocky’s GRUB config automatically adds the newest entry, but you can double‑check.
sudo grubby --set-default-index=0
This forces GRUB to boot the first (newest) entry on start‑up; otherwise an old kernel might keep sneaking back in.
Reboot and verify – A quick restart lets you confirm the switch.
sudo reboot
uname -rThe output should show something like 5.15.x-xanmod-lts. If it still shows the old Rocky kernel, double‑check your GRUB entry order.
Upgrade to the latest XanMod release
XanMod pushes updates roughly every month. Keeping up is as easy as a regular dnf upgrade:
sudo dnf update xanmod-lts
The command pulls only the kernel package, leaving the rest of your system untouched. After the download finishes, repeat the reboot‑verify step above.
If you ever need to roll back (say a new XanMod build breaks a specific driver), Rocky keeps the previous kernels in /boot. Just select an older entry from the GRUB menu on boot or run:
sudo grubby --set-default=/boot/vmlinuz-$(rpm -q --last kernel | head -1 | awk '{print $1}')
That line forces GRUB to point at the most recent non‑XanMod kernel you still have installed.
A word of caution
XanMod isn’t a magic bullet. If your workload is light and you never hit the performance ceiling, you might not notice any difference. Also, because it pulls in newer scheduler code, occasional regressions can appear – I’ve seen a rare “CPU soft lockup” after a kernel update that required a quick downgrade. Keep an eye on the boot logs (journalctl -b) if something feels off.
That’s it. You now have a faster‑tuning kernel under Rocky 8 and know how to keep it fresh without breaking your system.