---
title: "Learn how to Update the Kernel In Ubuntu Linux Safely"
description: "In this ATA Learning tutorial learn the ins-and-outs to update the kernel in Ubuntu Linux safely through several different methods!"
canonical: "https://adamtheautomator.com/update-the-kernel-in-ubuntu/"
---

# Learn how to Update the Kernel In Ubuntu Linux Safely

> In this ATA Learning tutorial learn the ins-and-outs to update the kernel in Ubuntu Linux safely through several different methods!

Source: https://adamtheautomator.com/update-the-kernel-in-ubuntu/

---

ATA Learning

Tap to hide

[

ATA Learning

](/)

*   [Home](/)
*   [Tutorials](/tutorials/)
*   [Instructors](/author/)
*   [Advertising](/advertising/)
*   [Recommended Resources](/resources/)
*   [About Adam](/about-adam/)

Search for:  

*   [](https://twitter.com/adbertram)
*   [](https://github.com/Adam-the-Automator)
*   [](https://www.linkedin.com/company/adam-the-automator-llc)
*   [](/feed/)

![Learn how to Update the Kernel In Ubuntu Linux Safely](https://adamtheautomator.com/wp-content/uploads/2023/07/update-the-kernel-in-ubuntu.jpg)

# Learn how to Update the Kernel In Ubuntu Linux Safely

[![](https://secure.gravatar.com/avatar/1bc5e1d52466fc3739f550c8d78be310684747bf1466a98d698320627ea243e2?s=192&d=mm&r=g)Michael Nguyen Tu](https://adamtheautomator.com/author/michael-nguyen-tu/)26 July 20236 min. read

Categories: [IT Ops](/category/it-ops/)

Tags:[Linux](/tag/linux/)[Ubuntu Linux](/tag/ubuntu-linux/)

Table of Contents

*   [Prerequisites](#prerequisites)
*   [Installing the Mainline Kernel Installer](#installing-the-mainline-kernel-installer)
*   [Updating Ubuntu Kernel via the Mainline Kernel Installer](#updating-ubuntu-kernel-via-the-mainline-kernel-installer)
*   [Updating the Ubuntu Kernel via DEB Packages](#updating-the-ubuntu-kernel-via-deb-packages)
*   [Rolling Back to a Previous Kernel Version](#rolling-back-to-a-previous-kernel-version)
*   [Removing Problematic Kernels](#removing-problematic-kernels)
*   [Conclusion](#conclusion)

Besides updating system packages, why not update the Kernel in Ubuntu system? As your Ubuntu system’s core, updating the Kernel is crucial in maintaining security and stability.

In this tutorial, you will learn to safely update your Kernel and remove problematic ones in your Ubuntu system.

Read on to keep your system secure and stable!

## Prerequisites

This tutorial houses hands-on demonstrations. If you wish to follow along, be sure you have a system running Ubuntu Linux 18 or later, but this tutorial uses [Ubuntu 20.04 LTS](https://adamtheautomator.com/install-ubuntu/).

Related:[How to Install Ubuntu 20.04 \[Step-by-Step\]](https://adamtheautomator.com/install-ubuntu/)

## **Installing the Mainline Kernel Installer**

The Mainline Kernel Installer is a graphical tool that lets you quickly and safely install your Ubuntu system’s latest mainline Linux kernel. But just like other tools, you must first install the Mainline Kernel Installer on your system.

To install the Mainline Kernel Installer, follow these steps:

1\. Open a terminal and run the below [`apt update`](https://linuxize.com/post/how-to-use-apt-command/#updating-package-index-apt-update) command to ensure your system has all the latest package indexes.

```bash
sudo apt update -y
```

![Updating the package indexes](https://adamtheautomator.com/wp-content/uploads/2023/07/image-234.png)

Updating the package indexes

Related:[Learning Ubuntu Apt Get Through Examples](https://adamtheautomator.com/ubuntu-apt-get/)

2\. Next, execute the below [`add-apt-repository`](https://linuxize.com/post/how-to-add-apt-repository-in-ubuntu/) command to add the Cappelikan Personal Package Archive (PPA) (`ppa:cappelikan/ppa`) to your system’s repository list. A PPA allows you to access additional software packages not included in the official Ubuntu repositories.

The Cappelikan PPA contains packages related to the Linux kernel, including mainline kernel builds and backported kernels.

```bash
sudo add-apt-repository ppa:cappelikan/ppa -y
```

![Adding the Cappelikan PPA](https://adamtheautomator.com/wp-content/uploads/2023/07/image-233.png)

Adding the Cappelikan PPA

3\. Run the following command to `update` the packages list again to ensure your system now includes the packages from the Cappelikan PPA.

```bash
sudo apt update -y
```

![Update the packages list](https://adamtheautomator.com/wp-content/uploads/2023/07/image-232.png)

Update the packages list

4\. Finally, execute the [`apt install`](https://linuxize.com/post/how-to-use-apt-command/#installing-packages-apt-install) command below to install the `mainline` Kernel Installer.

```bash
sudo apt install mainline -y
```

![Installing the Mainline Kernel Installer](https://adamtheautomator.com/wp-content/uploads/2023/07/image-231.png)

Installing the Mainline Kernel Installer

## Updating Ubuntu Kernel via the Mainline Kernel Installer

Now that the Mainline Kernel Installer is installed, it is time to get your hands dirty updating your system’s Kernel to the latest version. The Mainline Kernel Installer simplifies the mainline kernel’s installation process by providing a graphical interface that guides you through the installation.

How this installer works is that it fetches the latest kernel files from the Ubuntu mainline kernel repository, downloads, verifies, and installs them on your system.

To update your Ubuntu Kernel via the Mainline Kernel Installer:

1\. Run the below [`uname`](https://linuxize.com/post/uname-command-in-linux/) command to get the information about your current Kernel.

```bash
uname -mrs
```

You will see a similar output below with the following:

*   **Linux** – Indicates the OS you are running, which is Linux.
*   **5.15.0-76-generic** – Represents the specific kernel version you have installed on your system.
*   **x86\_64** – Refers to your system’s architecture, in this case, 64-bit (amd64).

![Retrieving the current Kernel information](https://adamtheautomator.com/wp-content/uploads/2023/07/image-243.png)

Retrieving the current Kernel information

2\. Next, open the Mainline Kernel Installer (**Mainline Kernels**) from the Ubuntu Application Launcher, as shown below.

![Launching the Mainline Kernel Installer](https://adamtheautomator.com/wp-content/uploads/2023/07/image-242.png)

Launching the Mainline Kernel Installer

3\. When the Mainline Kernel Installer opens, click **Reload** to fetch the latest available Kernel versions from the mainline kernel repository.

![Fetching the latest available kernel versions](https://adamtheautomator.com/wp-content/uploads/2023/07/image-241.png)

Fetching the latest available kernel versions

4\. Once reloaded, click **Settings** to access the Mainline Kernels settings.

![Accessing the Mainline Kernels settings](https://adamtheautomator.com/wp-content/uploads/2023/07/image-240.png)

Accessing the Mainline Kernels settings

5\. Now, tick the **Verify Downloads with the CHECKSUM files** box, and click **Done**.

This feature ensures the downloaded Kernels are valid and not corrupted.

![Enabling verifying downloaded Kernels](https://adamtheautomator.com/wp-content/uploads/2023/07/image-239.png)

Enabling verifying downloaded Kernels

6\. Oble Kernels are downloaded and listed, select a desired version from the list and click **Install**.

The latest version is strongly recommended, which at this time of writing is **6.4.3**.

![Installing the latest Kernel version](https://adamtheautomator.com/wp-content/uploads/2023/07/image-238.png)

Installing the latest Kernel version

A new Mainline Kernels terminal appears, indicating the installation process begins, which may take time to complete.

![Overviewing the Kernel installation](https://adamtheautomator.com/wp-content/uploads/2023/07/image-237.png)

Overviewing the Kernel installation

7\. When prompted, enter your password to authenticate and proceed with the installation.

![Authenticating the Kernel installation](https://adamtheautomator.com/wp-content/uploads/2023/07/image-236.png)

Authenticating the Kernel installation

8\. Lastly, once the installation finishes, reboot your system for the changes to take effect, and un the below `grep` command to verify the new Kernel version is running.

```bash
sudo dmesg | grep "Linux version"
```

Related:[Unlock the Power of These grep Equivalents in Windows](https://adamtheautomator.com/grep-equivalents-in-windows/)

You will see your current Kernel version, as shown below.

![Verifying the newly-installed Kernel version is running](https://adamtheautomator.com/wp-content/uploads/2023/07/image-235.png)

Verifying the newly-installed Kernel version is running

## Updating the Ubuntu Kernel via DEB Packages

If you are uncomfortable updating your Kernels via the Mainline Kernel Installer’s GUI, another option by downloading and installing the Kernel’s DEB packages.

Related:[Comprehensive Guide to Install Deb Packages on Ubuntu](https://adamtheautomator.com/install-deb-packages-on-ubuntu/)

These DEB packages provide the latest release candidate (RC) builds of the Kernel, which are unavailable through the mainline Kernels. RC builds are pre-release Kernel versions made available for testing and evaluation before the final stable release.

> 💡 _Note that these kernel builds may not have passed all tests and can contain bugs._

To update your Kernel via the DEB packages:

1\. Open your favorite web browser (like Firefox or Google Chrome), and visit the [official Ubuntu Kernel page](https://kernel.ubuntu.com/~kernel-ppa/mainline/daily/).

Related:[How to Install Google Chrome for Ubuntu](https://adamtheautomator.com/install-google-chrome-for-ubuntu/)

2\. From the list of available releases, click the latest one that has passed all tests successfully and has no reported issues.

As of this time of writing, the latest release is [2023-07-15](https://kernel.ubuntu.com/~kernel-ppa/mainline/daily/2023-07-15/).

![Selecting the latest Kernel release](https://adamtheautomator.com/wp-content/uploads/2023/07/image-248.png)

Selecting the latest Kernel release

> 💡 _Do not select the [2023-07-16](https://kernel.ubuntu.com/~kernel-ppa/mainline/daily/2023-07-16/) release since both Test amd64/self-tests and Test amd64/build failed, as shown below. Ensure you choose a release without known test failures to avoid potential issues._

![Avoiding a failed release](https://adamtheautomator.com/wp-content/uploads/2023/07/image-247.png)

Avoiding a failed release

3\. Download the required DEB package as follows:

*   On the selected release page, look for a pack suitable for your system architecture (i.e., amd64 for 64-bit systems).
*   Click on each hyperlink to download all the DEB packages to your _~/Download_ directory. Each downloaded package file will have a _.deb_ extension.

![Downloading DEB packages to the ~/Download directory](https://adamtheautomator.com/wp-content/uploads/2023/07/image-246.png)

Downloading DEB packages to the _~/Download_ directory

4\. Open a terminal, navigate to the _~/Download_ directory, and run the below [`dpkg`](https://www.digitalocean.com/community/tutorials/dpkg-command-in-linux) command to install all `*.deb` packages.

```bash
sudo dpkg -i *.deb
```

Wait for the installation to finish, and reboot your system afterward to apply the changes.

![Installing all downloaded DEB packages](https://adamtheautomator.com/wp-content/uploads/2023/07/image-245.png)

Installing all downloaded DEB packages

5\. Now, run the below command to check the Kernel version installed.

```bash
uname -r
```

You now have the latest release candidate Kernel version (**6.5.0**) running on your system, as shown below.

![Checking the installed Kernel version](https://adamtheautomator.com/wp-content/uploads/2023/07/image-244.png)

Checking the installed Kernel version

## Rolling Back to a Previous Kernel Version

You have just updated your Kernel to the latest version, which is awesome. But as you may know, not all Kernel updates are successful.

Compatibility issues, bugs, or conflicts with certain hardware or software configurations get in the way of Kernel updates. These issues can result in system instability and boot failures. In such cases, you may need to roll back to the previous version, which helps restore system stability and functionality.

To roll back to a previous Kernel on your Ubuntu system:

1\. Open the _/etc/default/grub_ file in your preferred text editor. This file allows you to control the default boot behavior and select different kernel versions and boot options.

Related:[Essential Tips for Installing & Using Sublime Text on Ubuntu](https://adamtheautomator.com/sublime-text-on-ubuntu/)

2\. Next, configure the following:

*   `GRUB_TIMEOUT_STYLE=menu` – Lets you define the style of the GRUB timeout behavior. When the value is set to `menu`, the GRUB menu displays and waits for user input within the defined timeout period. This behavior allows you to select the desired Kernel to boot manually.

Related:[Ubuntu GRUB Linux Bootloader and Configuration](https://adamtheautomator.com/ubuntu-grub/)

*   `GRUB_TIMEOUT=10` – Sets the duration (in seconds) for which the GRUB menu will be displayed before automatically booting the default entry.  
    In this case, the value is set to `10` seconds. During this period, you can press any key to interrupt the countdown and access the GRUB menu.

Once configured, save the changes and close the file.

![Configuring GRUB Bootloader](https://adamtheautomator.com/wp-content/uploads/2023/07/image-254.png)

Configuring GRUB Bootloader

3\. Execute the below `update-grub` command and reboot your system for the modifications to take effect. Once your system boots up, the GRUB menu appears with all your installed OSes (step four).

```bash
sudo update-grub
```

![update the kernel in ubuntu - Applying the GRUB changes](https://adamtheautomator.com/wp-content/uploads/2023/07/image-253.png)

Applying the GRUB changes

4\. Now, use the arrow keys on your keyboard to highlight the second option (**Advanced options for Ubuntu**), and press Enter to select it.

![Selecting advanced options for Ubuntu](https://adamtheautomator.com/wp-content/uploads/2023/07/image-252.png)

Selecting advanced options for Ubuntu

5\. Select the previous Kernel version to boot into, and press **Enter** to confirm your selection.

![Selecting the previous Kernel version](https://adamtheautomator.com/wp-content/uploads/2023/07/image-251.png)

Selecting the previous Kernel version

You will now be logged into the selected Kernel and can use Ubuntu as usual.

![Viewing the loading progress of the selected previous Kernel](https://adamtheautomator.com/wp-content/uploads/2023/07/image-250.png)

Viewing the loading progress of the selected previous Kernel

6\. Lastly, log in with your credentials to access your Ubuntu desktop test if everything works normally.

![Logging in to the loaded Kernel](https://adamtheautomator.com/wp-content/uploads/2023/07/image-249.png)

Logging in to the loaded Kernel

## Removing Problematic Kernels

If you find that booting into a previous Kernel has resolved your issue, you no longer need to keep the problematic Kernel. Doing so helps save disk space by eliminating unwanted problematic Kernels.

To remove problematic Kernels, follow the steps below:

1\. Execute the below command to `list` all your `--installed` Kernels (`linux-image`).

```bash
sudo apt list --installed | grep linux-image
```

Look for the problematic Kernel version, and note down its package name for later use.

The package name should be in the form of **linux-image-VERSION-generic**, as shown below.

![Listing all installed Kernels](https://adamtheautomator.com/wp-content/uploads/2023/07/image-257.png)

Listing all installed Kernels

2\. Next, run the following command to `remove` the problematic Kernel. Be sure to replace `kernel-name` with the package name you noted in the previous step.

```bash
sudo apt remove kernel-name
```

![Removing a specific problematic Kernel](https://adamtheautomator.com/wp-content/uploads/2023/07/image-256.png)

Removing a specific problematic Kernel

3\. Finally, reboot your system to apply the changes, and rerun the command below to list all installed Kernels.

```bash
sudo apt list --installed | grep linux-image
```

Below, you can verify the problematic Kernel (6.5.0) has been removed.

![Verifying the problematic Kernel no longer exists](https://adamtheautomator.com/wp-content/uploads/2023/07/image-255.png)

Verifying the problematic Kernel no longer exists

## Conclusion

Throughout this tutorial, you have learned to safely update your Kernel and remove unwanted ones to keep your system running smoothly. Maintaining a safe and reliable environment is now within your reach.

At this point, you can confidently keep your Kernel up-to-date via the Mainline Kernel Installer or install the latest RC DEB package builds.

Problematic Kernels is one thing, but Ubuntu startup issues can get on your nerve too. Why not learn to fix Ubuntu startup issues with Ubuntu Boot Repair effortlessly?

Related:[Effortlessly Use Ubuntu Boot Repair to Fix Startup Issues](https://adamtheautomator.com/ubuntu-boot-repair/)

Share this article

[Share on X](https://twitter.com/intent/tweet?url=https%3A%2F%2Fadamtheautomator.com%2Fupdate-the-kernel-in-ubuntu%2F&text=Learn%20how%20to%20Update%20the%20Kernel%20In%20Ubuntu%20Linux%20Safely)[Share on Facebook](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fadamtheautomator.com%2Fupdate-the-kernel-in-ubuntu%2F)[Share on LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fadamtheautomator.com%2Fupdate-the-kernel-in-ubuntu%2F)

## Related Posts

![](https://adamtheautomator.com/wp-content/uploads/2024/03/openldap-4.jpg)

### [How to Install and Configure an OpenLDAP Ubuntu Server](/openldap/)

Unlock the power of OpenLDAP on Ubuntu for centralized user authentication, seamless access control management, and enhanced directory services!

![](https://adamtheautomator.com/wp-content/uploads/2023/08/install-go-on-ubuntu-1.jpg)

### [How to Install GO on Ubuntu Linux](/install-go-on-ubuntu/)

Learn the ins-and-outs of how to install GO Ubuntu Linux and see how you can take advantage of this popular programming language!

![](https://adamtheautomator.com/wp-content/uploads/2023/04/upgrade-ubuntu.jpg)

### [How to Upgrade Ubuntu Linux to a New Release](/upgrade-ubuntu/)

Learn how to easily upgrade Ubuntu to the latest release. Also known as a distribution upgrade, learn how to tackle the upgrade in this ATA Learning tutorial!

## Categories

*   [IT Ops](/category/it-ops/)
*   [Cloud](/category/cloud/)
*   [DevOps](/category/devops/)
*   [Home Ops](/category/home-ops/)
*   [Information Security](/category/infosec/)
*   [Software Development](/category/software-development/)

## Site

*   [Home](/)
*   [Tutorials](/tutorials/)
*   [Instructors](/author/)
*   [Advertising](/advertising/)
*   [Recommended Resources](/resources/)
*   [About Adam](/about-adam/)

Copyright 2026© ATA Learning | [Privacy Policy](/privacy/)
