The default kernel shipped with CentOS Stream prioritizes stability over new features. If you need support for the latest hardware, improved performance for modern workloads, or access to new kernel features, the ELRepo project provides newer kernel packages. This guide walks through adding the ELRepo repository, installing either the mainline (kernel-ml) or long-term (kernel-lt) kernel, verifying the installation, applying updates, and restoring your original kernel if needed.
This guide covers CentOS Stream 10 and CentOS Stream 9. Commands work identically on both versions unless noted otherwise. CentOS Stream 8 reached end-of-life in May 2024 and is no longer covered. Notable difference: kernel-lt (long-term) is available only on CentOS Stream 9; CentOS Stream 10 provides only kernel-ml (mainline).
Choose Your Kernel Option
ELRepo provides two kernel packages with different update philosophies. Understanding the difference helps you choose the right one for your environment.
| Kernel Option | Package Name | Update Frequency | Best For | Stream 10 |
|---|---|---|---|---|
| Mainline (ML) | kernel-ml | Frequent (tracks latest stable) | Latest features, newest hardware support, developers | ✅ Available |
| Long-Term (LT) | kernel-lt | Less frequent (extended support) | Production servers, stability-focused environments | ❌ Not available |
For most users, kernel-ml is recommended because it provides the latest stable kernel with current hardware support and security fixes. Choose kernel-lt only if you specifically need extended maintenance cycles or have validated your workloads against that branch. On CentOS Stream 10, kernel-ml is the only option.
Install the ELRepo Repository
Update Your System
Before adding any third-party repository, update your existing packages to ensure compatibility:
sudo dnf upgrade --refresh
Import the ELRepo GPG Key and Repository
ELRepo packages are signed with a GPG key for authenticity verification. Import the key and install the repository package for your CentOS Stream version.
CentOS Stream 10:
sudo dnf install -y https://www.elrepo.org/elrepo-release-10.el10.elrepo.noarch.rpm
CentOS Stream 9:
sudo dnf install -y https://www.elrepo.org/elrepo-release-9.el9.elrepo.noarch.rpm
DNF prompts you to import the ELRepo GPG key during installation. Accept the key to continue.
ELRepo recently introduced a new signing key (v2). CentOS Stream 10 requires the v2 key due to stricter cryptographic policies. The
dnf installcommand handles key verification automatically during package installation on both versions.
Verify the Repository Installation
Confirm that ELRepo was added successfully by listing active repositories:
dnf repolist
The output should include the ELRepo repository:
repo id repo name appstream CentOS Stream 10 - AppStream baseos CentOS Stream 10 - BaseOS elrepo ELRepo.org Community Enterprise Linux Repository - el10 extras-common CentOS Stream 10 - Extras packages
View Available Kernel Packages
List the kernel packages available from ELRepo to see current versions:
dnf list available --disablerepo='*' --enablerepo=elrepo-kernel
Example output on CentOS Stream 10 (your versions may differ):
Available Packages kernel-ml.x86_64 6.18.7-1.el10.elrepo elrepo-kernel kernel-ml-core.x86_64 6.18.7-1.el10.elrepo elrepo-kernel kernel-ml-devel.x86_64 6.18.7-1.el10.elrepo elrepo-kernel kernel-ml-headers.x86_64 6.18.7-1.el10.elrepo elrepo-kernel kernel-ml-modules.x86_64 6.18.7-1.el10.elrepo elrepo-kernel kernel-ml-modules-extra.x86_64 6.18.7-1.el10.elrepo elrepo-kernel
On CentOS Stream 9, you will also see kernel-lt packages alongside kernel-ml.
Install the Mainline Kernel
Install kernel-ml
Install the mainline kernel by enabling the elrepo-kernel repository:
sudo dnf --enablerepo=elrepo-kernel install kernel-ml
This command installs the mainline kernel along with its core modules. DNF automatically handles dependencies including kernel-ml-core and kernel-ml-modules.
Install Additional Kernel Packages (Optional)
If you compile kernel modules, build custom software, or need extended module support, install the full kernel development suite:
sudo dnf --enablerepo=elrepo-kernel install kernel-ml kernel-ml-core kernel-ml-headers kernel-ml-modules kernel-ml-modules-extra kernel-ml-devel
The kernel-ml-devel package provides files needed for building external kernel modules (DKMS, VirtualBox, NVIDIA drivers). The kernel-ml-headers package contains header files for compiling userspace programs that interact with kernel APIs.
Install the Long-Term Kernel (Stream 9 Only)
On CentOS Stream 9, you can alternatively install the long-term support kernel:
sudo dnf --enablerepo=elrepo-kernel install kernel-lt
For development packages on the LT kernel:
sudo dnf --enablerepo=elrepo-kernel install kernel-lt kernel-lt-core kernel-lt-headers kernel-lt-modules kernel-lt-modules-extra kernel-lt-devel
The kernel-lt packages are not available on CentOS Stream 10. If you need extended support cycles on Stream 10, continue using the distribution’s default kernel or consider Stream 9.
Reboot to Activate the New Kernel
The new kernel takes effect after a reboot. The bootloader (GRUB) will present the new kernel as an option, typically at the top of the list:
sudo reboot
During the boot process, the GRUB menu displays available kernels. The newly installed mainline kernel should appear first. If the new kernel causes issues, you can select your original kernel from this menu to boot into a known-working configuration.
Verify the Installation
After rebooting, confirm that your system is running the new kernel.
Check the Running Kernel Version
Display the currently active kernel version:
uname -r
The output should show the kernel-ml version you installed:
6.18.7-1.el10.elrepo.x86_64
For more detailed system information including the kernel version, hostname, and architecture:
uname -a
Linux hostname 6.18.7-1.el10.elrepo.x86_64 #1 SMP PREEMPT_DYNAMIC ... x86_64 GNU/Linux
Update the Mainline Kernel
ELRepo regularly updates its kernel packages. Standard system updates will include new kernel versions when available:
sudo dnf upgrade --refresh
After any kernel update, reboot to activate the new version. The previous kernel remains available in the GRUB menu as a fallback option.
Restore the Default Kernel
If you encounter compatibility issues with the mainline kernel or decide to return to the distribution’s default kernel, follow these steps.
Boot Into the Original Kernel
Reboot your system and select the original CentOS Stream kernel from the GRUB menu. This is typically listed as the second or third option after the mainline kernel entries.
Disable the ELRepo Kernel Repository
Prevent future kernel updates from installing mainline versions by disabling the elrepo-kernel repository:
sudo dnf config-manager --set-disabled elrepo-kernel
Verify that the repository is disabled:
dnf repolist
The elrepo-kernel repository should no longer appear in the output:
repo id repo name appstream CentOS Stream 10 - AppStream baseos CentOS Stream 10 - BaseOS elrepo ELRepo.org Community Enterprise Linux Repository - el10 extras-common CentOS Stream 10 - Extras packages
The base elrepo repository remains enabled (it provides hardware drivers and other packages), but elrepo-kernel is now disabled and will not provide kernel updates.
Reinstall the Default Kernel (Optional)
If the default kernel packages were modified or you want to ensure they are properly configured, reinstall them:
sudo dnf reinstall kernel kernel-core kernel-modules
Reboot and select the default kernel from the GRUB menu:
sudo reboot
Remove Unused Mainline Kernels (Optional)
After confirming your system boots correctly with the default kernel, you can remove the mainline kernel packages to free disk space:
sudo dnf remove kernel-ml kernel-ml-core kernel-ml-modules kernel-ml-modules-extra
Always keep at least one working kernel installed before removing others. Never remove the kernel you are currently running. If unsure which kernel is active, check with
uname -rbefore proceeding.
Troubleshooting
System Fails to Boot After Kernel Installation
If your system fails to boot with the new kernel, use the GRUB menu to select an older kernel:
- Reboot the system and wait for the GRUB menu to appear (you may need to press Esc or hold Shift during boot)
- Select a previous kernel version from the list (typically under “Advanced options for CentOS Stream”)
- Once booted, disable the failing kernel or remove it as described in the restoration section
dnf config-manager Command Not Found
On minimal installations, the dnf config-manager command may not be available. Install the required plugin:
sudo dnf install -y dnf-plugins-core
Then retry the dnf config-manager command.
Third-Party Kernel Modules Stop Working
Kernel modules built for your original kernel (VirtualBox, NVIDIA drivers, custom DKMS modules) may need recompilation after installing a new kernel. Install the kernel-ml-devel package and rebuild affected modules:
sudo dnf --enablerepo=elrepo-kernel install kernel-ml-devel
sudo dkms autoinstall
The dkms package is available from EPEL. If you have not installed EPEL, run sudo dnf install epel-release first. For NVIDIA proprietary drivers, you may need to reinstall them from the vendor’s installer or use the NVIDIA RPM packages designed for your new kernel version.
Set the Default Boot Kernel
If you want to permanently set a specific kernel as the default boot option, use grubby:
List installed kernels:
sudo grubby --info=ALL
Set a specific kernel as default (replace the path with the kernel you want):
sudo grubby --set-default=/boot/vmlinuz-6.18.7-1.el10.elrepo.x86_64
Frequently Asked Questions
Not immediately. ELRepo kernels are signed, but their public key is not included in your system’s trusted UEFI database by default. To boot these kernels with Secure Boot enabled, you must manually enroll the ELRepo key into your system’s MOK (Machine Owner Key) list using the mokutil utility. Alternatively, you can disable Secure Boot in your BIOS/UEFI settings, though this lowers system security.
No. The new kernel is installed alongside your existing kernels. CentOS Stream preserves your original kernels so you can select them from the boot menu if the new version fails to start. By default, the system keeps the three most recent kernel versions to ensure you always have a working fallback.
CentOS Stream is the upstream development platform for Red Hat Enterprise Linux (RHEL), prioritizing long-term stability and binary compatibility (kABI). The default kernel is built to run reliably for years, whereas mainline kernels (kernel-ml) are released frequently with bleeding-edge features that have not undergone the same level of enterprise validation.
They will likely break initially. Proprietary drivers and kernel modules often rely on specific kernel headers. When you switch to a mainline kernel, you must install the matching kernel-ml-devel and kernel-ml-headers packages and recompile your modules (often handled automatically by dkms or akmods). If you skip this step, your graphics or virtualization drivers may fail to load.
Conclusion
You now have a mainline Linux kernel running on CentOS Stream, providing access to the latest kernel features and hardware support. The ELRepo repository will continue to provide updates as new kernel versions are released. To maintain your system, run regular dnf upgrade commands and reboot to activate kernel updates. If you encounter issues, you can always boot into your original kernel from the GRUB menu or fully restore it using the steps in this guide.