Whenever you try to work with a Linux distribution such as Ubuntu, a Kernel will be installed automatically, because the whole system can not run without it. You can update Kernel on Ubuntu like any other packages. In this article, you will learn How to Upgrade Kernel on Ubuntu 20.04 | 22.04. If you want to purchase Ubuntu VPS Server, check out the offered packages on the Eldernode website.
How to Upgrade Kernel on Ubuntu 20.04 | 22.04
Introduction to Kernel
The Kernel is the core of Linux distributions, which is the interface between hardware and software in this operating system. Linux Kernel updates are constantly released, allowing you to update your Linux Kernel version to enjoy the latest features, tools and security measures.
In the continuation of this article from the Ubuntu training series, we are going to teach you step by step how to Upgrade Kernel on Ubuntu 20.04 | 22.04.
Upgrade Kernel on Ubuntu 20.04 | 22.04
First check the version of Kernel running on your Ubuntu Linux with the following command:
Before starting, first run the following command to update all system packages:
sudo apt update
sudo apt upgrade
Then use the command below to install wget tool:
sudo apt install wget
You can download the Kernel Deb binary from the Ubuntu Linux repository or download the script on GitHub using the following command:
Then run the commands below to make the script executable:
chmod +x ubuntu-mainline-kernel.sh
sudo mv ubuntu-mainline-kernel.sh /usr/local/bin/
Now you can search and find the latest version of Kernel that is available to install with the following command:
Also you can see the list of available versions of Kernel to install, using the command below:
Run the following command to install the latest version of the Kernel:
sudo ubuntu-mainline-kernel.sh -i
If you want to install any other version of the Kernel, you can use the following command:
sudo ubuntu-mainline-kernel.sh -i version-number
To list the available versions of Kernel on your system, using the same script, run the command below:
sudo ubuntu-mainline-kernel.sh -l
Now restart your system to use the installed version:
You can check your current version of Kernel using the command below:
You can choose which version of the Kernel to run, otherwise by default, Ubuntu automatically selects the latest installed version.
Then run the following command to edit Grub file:
sudo nano /etc/default/grub
Add the lines below to the Grub file, then save it with Ctrl+O, press Enter and finally exit the file with Ctrl+X:
You can update Grub using the following command:
Finally restart your system:
In the system reboot stage, press the Esc key to get the Grub menu, then select Advanced Options for Ubuntu and finally select the default Kernel version for your system:
You can uninstall Kernel from your system using the following command:
sudo ubuntu-mainline-kernel.sh -u
Linux Kernel updates are released constantly, so you can synchronize your Ubuntu kernel version with the latest version.
Is it possible to simultaneously upgrade Ubuntu to 22.04 and Ubuntu Kernel to its latest stable version?
You should first upgrade Ubuntu to 22.04 and then upgrade Ubuntu Kernel to the latest version.
As we reviewed, Kernel is the core of Ubuntu and the whole system can not run without it. Also in this article, you learned How to Upgrade Kernel on Ubuntu 20.04 | 22.04, so you can enjoy new features and tools.