The Linux kernel update process begins by checking your current kernel version. Understanding how to update Linux kernel is essential for system stability, security, and access to new hardware support. This guide walks you through every step, from verifying your existing kernel to completing a safe upgrade.
Whether you’re a beginner or a seasoned sysadmin, keeping your kernel current is a critical maintenance task. Let’s get started with the basics before diving into the actual update methods.
Why Update The Linux Kernel
Updating the kernel brings several key benefits. Security patches fix vulnerabilities that could expose your system to attacks. New hardware drivers enable support for recent devices like graphics cards, network adapters, and storage controllers.
Performance improvements are another reason. Kernel updates often include optimizations that make your system run faster and more efficiently. Bug fixes resolve issues that might cause crashes or unexpected behavior.
Without regular updates, your system becomes vulnerable and may miss out on important features. It’s a simple step that pays off in reliability and safety.
Check Your Current Kernel Version
Before you update, you need to know what you’re running. Open a terminal and type the following command:
uname -r
This prints your current kernel version. For example, you might see something like 5.15.0-91-generic. Write this down or keep it in mind—you’ll compare it later to confirm the update worked.
Another useful command is:
uname -a
This shows more details, including the kernel release date and architecture. Knowing your architecture (like x86_64 or aarch64) helps when downloading kernels manually.
How To Update Linux Kernel On Ubuntu And Debian
Ubuntu and Debian-based systems make kernel updates straightforward using package managers. This is the most common method for desktop users.
Update Using APT Package Manager
The APT tool handles kernel updates automatically. Follow these steps:
- Open a terminal window.
- Update your package list:
sudo apt update - Upgrade all packages including the kernel:
sudo apt upgrade - If a new kernel is available, it will be installed. Reboot your system:
sudo reboot
After rebooting, check your kernel version again with uname -r. You should see a newer version number. If not, you may need to run sudo apt dist-upgrade to handle dependency changes.
Sometimes the kernel is held back. In that case, try:
sudo apt full-upgrade
This forces a more complete upgrade. Be careful—it can remove packages if needed, but it’s safe for kernel updates.
Install A Specific Kernel Version
If you want a particular kernel version, use this command:
sudo apt install linux-image-5.19.0-42-generic
Replace the version number with your desired kernel. You can also install headers for compiling modules:
sudo apt install linux-headers-5.19.0-42-generic
After installation, reboot and select the new kernel from the GRUB menu if prompted. The system will boot into the latest installed kernel by default.
How To Update Linux Kernel On Fedora And RHEL
Red Hat-based distributions use DNF or YUM for package management. The process is similar but with different commands.
Update Using DNF
On Fedora and newer RHEL versions, use DNF:
- Update all packages:
sudo dnf upgrade - This includes kernel updates automatically.
- Reboot after completion:
sudo reboot
To see available kernel versions, run:
sudo dnf list available kernel
If you need to install a specific kernel, use:
sudo dnf install kernel-5.19.0-200.fc36.x86_64
Again, replace with the actual version. Fedora tends to ship newer kernels quickly, so updates are frequent.
Update Using YUM (Older Systems)
For CentOS 7 or older RHEL, YUM is the tool:
sudo yum update kernel
This updates only the kernel package. You can also update everything with sudo yum update. Reboot afterwards.
Note that RHEL and CentOS often use long-term support kernels, so updates may be less frequent but more stable.
How To Update Linux Kernel On Arch Linux
Arch Linux uses a rolling release model, meaning kernel updates come continuously. The process is simple with Pacman.
Update Using Pacman
First, synchronize and upgrade:
sudo pacman -Syu
This updates all packages, including the kernel. If a new kernel is available, it will be installed. Reboot to use it.
Arch offers multiple kernel variants. The default is linux, but you can install linux-lts for long-term support or linux-zen for performance tuning.
To switch kernels, install the desired package:
sudo pacman -S linux-lts
Then update GRUB if needed:
sudo grub-mkconfig -o /boot/grub/grub.cfg
Reboot and choose the new kernel from the boot menu.
Manual Kernel Update From Source
Sometimes you need the latest kernel not yet in your distribution’s repositories. Compiling from source gives you full control but requires more work.
Download The Kernel Source
Visit kernel.org and download the latest stable tarball. Use wget or curl:
wget https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.5.tar.xz
Extract it:
tar -xf linux-6.5.tar.xz
cd linux-6.5
Configure The Kernel
You can use the current kernel’s configuration as a starting point:
cp /boot/config-$(uname -r) .config
Then run:
make menuconfig
This opens a text-based interface. You can adjust settings or just save and exit. For beginners, accepting defaults is fine.
Compile And Install
Compilation takes time. Use multiple cores to speed it up:
make -j$(nproc)
After compilation, install modules and the kernel:
sudo make modules_install
sudo make install
This copies files to /boot and updates GRUB automatically. Reboot and select your new kernel.
Be warned: manual compilation can fail if dependencies are missing. Install build tools first:
sudo apt install build-essential libncurses-dev bison flex libssl-dev libelf-dev
On Fedora, use:
sudo dnf groupinstall "Development Tools"
sudo dnf install ncurses-devel bison flex elfutils-libelf-devel openssl-devel
Using UKUU For Ubuntu Kernel Updates
UKUU (Ubuntu Kernel Update Utility) is a graphical tool that simplifies kernel management. It’s not official but widely used.
Install UKUU
Add the PPA and install:
sudo add-apt-repository ppa:teejee2008/ppa
sudo apt update
sudo apt install ukuu
Launch it from the terminal or application menu. The interface shows available kernels. Select one and click “Install”.
UKUU downloads and installs the kernel automatically. After installation, reboot. This method is user-friendly and avoids command-line complexity.
However, UKUU is no longer actively maintained. Consider alternatives like mainline for a similar experience:
sudo add-apt-repository ppa:cappelikan/ppa
sudo apt update
sudo apt install mainline
How To Update Linux Kernel Using Mainline Tool
Mainline is a modern GUI for installing upstream kernels on Ubuntu. It’s simple and reliable.
Install And Use Mainline
After installing mainline as shown above, launch it. You’ll see a list of available kernels from kernel.org. Click the one you want and press “Install”.
The tool downloads the kernel packages and installs them. It also handles GRUB updates. Reboot to apply changes.
Mainline supports both stable and release candidate kernels. Be cautious with RC versions—they may have bugs.
Verify The Update
After rebooting, confirm the update succeeded:
uname -r
Compare the output with your earlier version. It should be higher. Also check if the kernel is running without issues:
dmesg | grep -i error
Look for hardware errors or driver problems. If everything looks clean, your update was successful.
You can also check the boot log:
journalctl -b | grep -i kernel
This shows kernel messages from the current boot session.
Rollback To A Previous Kernel
Sometimes a new kernel causes problems. You can revert to an older version easily.
Using GRUB Boot Menu
During boot, hold Shift (BIOS) or press Esc (UEFI) to enter GRUB. Select “Advanced options for Ubuntu” (or your distro). You’ll see a list of installed kernels. Choose the older one.
Once booted, remove the problematic kernel:
sudo apt remove linux-image-5.19.0-42-generic
Replace with the version you want to remove. Then update GRUB:
sudo update-grub
On Fedora, use:
sudo dnf remove kernel-5.19.0-200.fc36.x86_64
Then rebuild GRUB:
sudo grub2-mkconfig -o /boot/grub2/grub.cfg
Common Issues And Troubleshooting
Kernel updates can sometimes fail or cause problems. Here are solutions to frequent issues.
Kernel Panic After Update
If your system crashes with a kernel panic, boot into an older kernel from GRUB. Then remove the new kernel as described above. Check for incompatible drivers or hardware.
Missing Modules
Some hardware may stop working after an update. Install missing modules:
sudo apt install linux-modules-extra-$(uname -r)
On Fedora:
sudo dnf install kernel-modules-extra
GRUB Not Showing New Kernel
If the new kernel isn’t listed in GRUB, update the bootloader:
sudo update-grub
Or on Fedora:
sudo grub2-mkconfig -o /boot/grub2/grub.cfg
Sometimes you need to check if the kernel files are in /boot. List them:
ls /boot/vmlinuz*
If the new kernel isn’t there, reinstall it.
Best Practices For Kernel Updates
Follow these tips to avoid headaches:
- Always backup important data before a major kernel update.
- Keep at least one older kernel installed as a fallback.
- Test new kernels on a non-production system first if possible.
- Read release notes for known issues.
- Update your system regularly rather than skipping many versions.
Using LTS kernels on production servers reduces risk. For desktops, mainline kernels offer newer features.
Frequently Asked Questions
How often should I update the Linux kernel?
It depends on your needs. Security updates should be applied promptly. For general use, updating every few months is fine. Production servers often stick to LTS kernels with periodic updates.
Can updating the kernel break my system?
Yes, it’s possible. Incompatible drivers or hardware can cause issues. Always keep an older kernel as a backup. Test on a non-critical system first.
Do I need to update the kernel manually?
Not usually. Package managers handle kernel updates automatically. Manual updates are only needed for bleeding-edge kernels or custom configurations.
What’s the difference between stable and LTS kernels?
Stable kernels get frequent updates with new features. LTS (Long Term Support) kernels receive only bug and security fixes for years. LTS is better for stability-critical systems.
How do I know if my hardware supports a new kernel?
Check the kernel’s hardware compatibility list. Most modern hardware works with recent kernels. For specific devices, search forums or the kernel’s changelog.
Conclusion
Learning how to update Linux kernel is a valuable skill for any Linux user. Whether you use a package manager, a GUI tool, or compile from source, the process is straightforward once you understand the steps.
Start with checking your current version, then choose the method that fits your distribution. Always verify the update and keep a fallback kernel. With practice, kernel updates become a routine part of system maintenance.
Remember to reboot after installation and test your system. If something goes wrong, you can always roll back. Stay updated, stay secure, and enjoy the improvements each new kernel brings.