Upgrade Linux Kernel to the Latest on Ubuntu 20.04 with Easy Steps
This tutorial aims to guide you on how to Upgrade Linux Kernel to the Latest on Ubuntu 20.04. If you’re looking to update your Linux Kernel on Ubuntu 20.04 to the newest release, this guide, presented by Orcacore, will provide step-by-step instructions. Keeping your kernel up-to-date is crucial for optimal system performance and security.
Before you begin to Upgrade Linux Kernel to the Latest on Ubuntu 20.04, ensure you’re logged into your server as a non-root user with sudo privileges. If you need assistance with this, refer to our guide on Initial Server Setup with Ubuntu 20.04.
Now, let’s proceed with the steps to Upgrade Linux Kernel to the Latest on Ubuntu 20.04.

Step 1 – Update Ubuntu 20.04 Repository
First, update and upgrade your Ubuntu system to ensure all existing packages are up to date. This step is crucial for a smooth kernel upgrade process. Execute the following commands:
# sudo apt update
# sudo apt upgrade -y
Step 2 – Check the Current Kernel Version on Ubuntu 20.04
Before upgrading, determine your current Linux kernel version. Use the following command:
uname -mr
**Output**
5.4.0-29-generic x86_64
The output indicates that the current Linux kernel version is "5.4.0-29-generic" on this Ubuntu 20.04 system.
Step 3 – Download Linux Kernel Bash Script
Download a kernel bash script, which facilitates the kernel upgrade process on Ubuntu 20.04. Use the following wget
command:
sudo wget https://raw.githubusercontent.com/pimlie/ubuntu-mainline-kernel.sh/master/ubuntu-mainline-kernel.sh
Make the downloaded file executable:
sudo chmod +x ubuntu-mainline-kernel.sh
Then, move the script to the /usr/local/bin/
directory:
sudo mv ubuntu-mainline-kernel.sh /usr/local/bin/
Step 4 – Update Ubuntu 20.04 Linux Kernel
Now, execute the following command to update your Linux Kernel on your Ubuntu server:
sudo ubuntu-mainline-kernel.sh -i
This command will automatically find the latest available Linux Kernel version and install it on your system.
**Output**
Finding latest version available on kernel.ubuntu.com
Latest version is: v6.3.5, continue? (y/N)
Will download 6 files from kernel.ubuntu.com:
Downloading amd64/linux-headers-6.3.5-060305-generic_6.3.5-060305.202305301445_amd64.deb: 100%
Downloading amd64/linux-headers-6.3.5-060305_6.3.5-060305.202305301445_all.deb: 100%
Downloading amd64/linux-image-unsigned-6.3.5-060305-generic_6.3.5-060305.202305301445_amd64.deb: 100%
Downloading amd64/linux-modules-6.3.5-060305-generic_6.3.5-060305.202305301445_amd64.deb: 100%
Downloading amd64/CHECKSUMS: 100%
Downloading amd64/CHECKSUMS.gpg: 100%
Importing kernel-ppa gpg key ok
Signature of checksum file has been successfully verified
Checksums of deb files have been successfully verified with sha256sum
Installing 4 packages
Cleaning up work folder
Step 5 – Reboot Ubuntu 20.04
Once the installation is complete, reboot your system for the new kernel to become active:
reboot
Step 6 – Confirm the new kernel version is running on Ubuntu 20.04
After logging back into your system, confirm that the new kernel version is running using the same command as before:
uname -mr
The output should display the new kernel version:
**Output**
6.3.5-060305-generic x86_64
That concludes the upgrade process.
Conclusion
You have successfully learned how to Upgrade Linux Kernel to the Latest on Ubuntu 20.04 using a straightforward method. The Linux Kernel plays a vital role in facilitating communication between hardware and software applications. Keeping it updated is a key practice.
You might also find these articles helpful:
Installing Apache Guacamole on Ubuntu 24.04
Install the Latest Zabbix on Ubuntu 24.04 Noble Numbat
Install Mozilla Firefox in Ubuntu Using Terminal
FAQs
Why should I upgrade kernel Ubuntu?
Upgrading the kernel can bring:
-Enhanced hardware support.
-Improved system performance.
-Bug fixes and security patches.
-New features and functionality.
Is it safe to upgrade the Linux Kernel?
Yes, but ensure you have:
-A backup of your critical data.
-An understanding of the process, as incorrect updates may lead to system instability.
Alternative Methods to Upgrade the Linux Kernel on Ubuntu 20.04
While the script-based method described above is convenient, there are alternative approaches to upgrade your Linux kernel on Ubuntu 20.04. Two such methods are detailed below:
Method 1: Using the ukuu
Tool (Ubuntu Kernel Update Utility)
ukuu
provides a graphical interface (though it can also be used via the command line) for managing and installing mainline kernels. It’s a user-friendly option that simplifies the process of downloading and installing kernels.
Installation:
First, add the ukuu
PPA to your system:
sudo add-apt-repository ppa:tikhonov/kernel-mainline
sudo apt update
Then, install ukuu
:
sudo apt install ukuu
Usage:
-
Launch
ukuu
: You can launch it from the command line by typingukuu
or find it in your applications menu. -
Select a Kernel:
ukuu
will display a list of available kernels. Choose the one you want to install. -
Install the Kernel: Click the "Install" button.
ukuu
will download and install the selected kernel. -
Reboot: After the installation is complete, reboot your system.
Command-Line Usage (Optional):
You can also use ukuu
from the command line. For example, to list available kernels:
ukuu --list
To install a specific kernel (replace <kernel_version>
with the actual version):
sudo ukuu --install <kernel_version>
Benefits:
- Simplified installation process.
- Graphical interface for easy kernel selection.
- Option to remove older kernels.
Drawbacks:
- Relies on a third-party PPA.
- Mainline kernels may be less stable than those provided by Ubuntu.
Method 2: Manual Kernel Installation from Kernel.org
This method involves manually downloading the kernel source code from kernel.org, compiling it, and installing it on your system. While more complex, it offers the greatest control over the kernel configuration. This is how advanced users Upgrade Linux Kernel to the Latest on Ubuntu 20.04.
Steps:
-
Download the Kernel Source: Visit kernel.org and download the latest stable kernel source code. Choose the "tar.xz" archive.
-
Extract the Archive: Extract the downloaded archive to a directory of your choice (e.g.,
/usr/src
):sudo tar -xvf linux-<version>.tar.xz -C /usr/src cd /usr/src/linux-<version>
-
Configure the Kernel: This is a crucial step. You can use your current kernel’s configuration as a starting point:
sudo cp /boot/config-$(uname -r) .config sudo make olddefconfig
Alternatively, you can use a graphical configuration tool:
sudo apt install libncurses5-dev sudo make menuconfig
Carefully review and adjust the kernel configuration to suit your needs. Incorrect configuration can lead to system instability.
-
Compile the Kernel: Compile the kernel using the following commands:
sudo apt install build-essential libssl-dev sudo make -j $(nproc) # Use all available cores for faster compilation sudo make modules_install sudo make install
-
Update the Bootloader: Update the GRUB bootloader to recognize the new kernel:
sudo update-grub
-
Reboot: Reboot your system to boot into the new kernel.
Benefits:
- Maximum control over kernel configuration.
- Access to the very latest kernel versions.
Drawbacks:
- Complex and time-consuming process.
- Requires significant technical expertise.
- Higher risk of system instability if not performed correctly.
Important Considerations for all methods:
- Backup Your Data: Before attempting any kernel upgrade, back up your important data. A failed kernel upgrade can render your system unbootable.
- Test in a Virtual Machine: Consider testing the upgrade process in a virtual machine before applying it to your production system.
- Monitor System Stability: After upgrading the kernel, closely monitor your system for any signs of instability.
- Consider DKMS: For drivers that are not included in the mainline kernel, use DKMS (Dynamic Kernel Module Support) to ensure they are automatically rebuilt when you upgrade the kernel.
By understanding these alternative methods, you can choose the approach that best suits your technical skills and risk tolerance when you Upgrade Linux Kernel to the Latest on Ubuntu 20.04.