Home Linux Kernel How To Install Latest Mainline Linux kernel On Ubuntu

How To Install Latest Mainline Linux kernel On Ubuntu

By sk

In this tutorial, we will learn how to install the latest mainline Kernel on Ubuntu and its derivatives such as Elementary OS, Linux Mint, Pop!_ OS and Zorin OS.


A few years ago, we published a guide on how to install the latest Linux kernel on Ubuntu systems using a tool called Ukuu. This was quite useful for those who want to use latest Kernel on their Ubuntu-based system.

Starting with Ukuu v19.01, the developer changed the application to a closed-source model and introduced a paid licensing system. This means users now need to buy a license to use the Ukuu app and get future updates. The reason for this change was reportedly due to a lack of donations.

This is quite understandable. Developers need to make a living, and it's reasonable for them to seek compensation for their work. The shift to a paid licensing system might be a necessary step for the developer to sustain themselves and continue maintaining the tool.

When a project becomes closed-source or introduces restrictions, it's not uncommon for the open-source community to respond by forking the project and creating an alternative.

In this case, Brian K. White, stepped in and forked the Ukuu project, ensuring that the original spirit of the project lives on, and users can still access a free and open-source solution for updating their Linux kernels.

Say Hello to Mainline, an Alternative to Ukuu

Mainline is a graphical application specifically designed for installing Ubuntu Mainline Kernel builds on Debian-based distributions.

Mainline simplifies the process of installing and managing Ubuntu Mainline Kernel Builds. These builds are newer versions of the Linux kernel that are not yet officially supported in Ubuntu releases.

Mainline fetches and displays a list of available mainline kernel versions. Users can see which kernels are available for download and installation.

Users can easily select and install the desired kernel version from the mainline repository. Mainline also allows users to remove old or unwanted kernels to keep their systems clean and free up disk space.

As I mentioned earlier, Mainline is an free alternative and fork of the original Ukuu (Ubuntu Kernel Update Utility) project.

While it's primarily aimed at Ubuntu and its derivatives, it can work on other Debian-based distributions as well.


Mainline offers several key features to help users manage their Ubuntu Mainline Kernel Builds.

  1. Download Kernel List: Mainline downloads the list of available kernels from the Ubuntu Mainline PPA. This allows users to see which kernel versions are available for installation.
  2. Display, Install, and Uninstall Kernels: Mainline provides a convenient way to display, install, and uninstall mainline-ppa kernels. Users can manage these actions through both a graphical user interface (GUI) and a command-line interface (CLI).
  3. Associated Packages: When installing or uninstalling a kernel, Mainline also handles the associated headers and modules packages. This ensures that all necessary components are downloaded, installed, or removed together.
  4. File Verification: Mainline verifies the downloaded .deb files using sha256 hashes from the CHECKSUMS files. This verification process ensures the integrity and authenticity of the downloaded kernel packages.
  5. Notifications: Mainline can optionally monitor for new kernel releases and send desktop notifications when new kernels become available. This feature keeps users informed about the latest updates without having to manually check for new versions.

Install Mainline on Ubuntu

You can install Mainline using either the PPA maintained by cappelikan or compile it from source. First, we will see the PPA method.

Install Mainline using PPA

1. Add the PPA:

sudo add-apt-repository ppa:cappelikan/ppa

2. Update your package list:

sudo apt update

3. Install Mainline:

sudo apt install mainline

Alternatively, you can install Mainline using the .deb packages provided in the releases. These packages are generated by the make release_deb command.

Build Mainline from Source

1. Install the required dependencies:

sudo apt install libgee-0.8-dev libjson-glib-dev libvte-2.91-dev valac aria2 lsb-release make gettext dpkg-dev

2. Clone the Mainline repository:

git clone https://github.com/bkw777/mainline.git

3. Navigate to the Mainline directory:

cd mainline

4. Build the project:


5. Install Mainline:

sudo make install

Launch Mainline

Once installed, you can find Mainline in your desktop's Applications or Dash or Start menu under System -> Mainline Kernels.

Launch Mainline from Ubuntu Dash
Launch Mainline from Ubuntu Dash

This is how Mainline's default interface looks like in my Ubuntu 24.04 LTS desktop:

Mainline Kernels Utility
Mainline Kernels Utility

Launch Mainline from Command Line Interface (CLI)

Run Mainline:


Display help information:

mainline --help

Launch Mainline from Graphical User Interface (GUI)

To run the Mainline GUI from CLI, run:


Note: Neither the CLI nor GUI commands require sudo or pkexec. The application runs with user privileges and internally uses pkexec only for the dpkg command. This design enhances security by limiting the use of elevated privileges.

Understanding Mainline Interface

The interface of Mainline is quite simple! It has the following columns:

  • Kernels - This lists the available and installed Kernels.
  • Lock - Shows whether the Kernel is locked.
  • Status - Shows the status of the Kernel.
  • Notes - Enables you to custom notes.
  • Function Buttons - Buttons to perform various actions like installing or removing Kernels.

Kernels Column

In this section, you will see all available kernel versions. By default, the latest version is shown at the top. You can sort them in any order you prefer.

Pinning / Locking Column

In Mainline, the Lock checkboxes serve to both whitelist and blacklist specific kernels. This is a crucial functionality that offers users more control over their kernel management.

Pinning and Locking Kernels
Pinning and Locking Kernels

Let us understand what exactly are pinning and locking.

1. Purpose of Locking:

  • Acts as both a whitelist and blacklist for kernels
  • Freezes a kernel in its current state (installed or uninstalled)

2. Effects of Locking:

  • Installed locked kernels stay installed
  • Uninstalled locked kernels remain uninstalled
  • Affects all install/uninstall commands and methods

3. GUI Behavior:

  • "Install" and "Uninstall" buttons become inactive for locked kernels
  • "Uninstall Old" button ignores locked kernels

4. CLI Behavior:

  • "--install" and "--uninstall" commands ignore locked kernels
  • "--uninstall-old" command ignores locked kernels
  • "--install-latest" and "--notify" (for background notifications) ignore locked kernels

5. Visibility and Interaction:

  • Locked kernels remain visible in the interface
  • Users can still write notes for locked kernels
  • PPA info page can still be accessed for locked kernels
  • The lock can be toggled to unlock a kernel

6. Practical Uses:

  • Prevent stock distribution kernels from being uninstalled by "Uninstall Old"
  • Prevent known buggy kernels from being installed by "--install-latest"
  • Avoid notifications for installing problematic kernels

This locking feature provides a flexible way to manage specific kernels according to your preferences and system requirements.

Status Column

In this section, you will see the state of the Kernel (i.e. installed, running)

Notes Column

Clicking on the Notes field allows you to attach arbitrary note text to a specific kernel.

To add a note, just double click on it and add your note.

This feature lets you document important information or observations about different kernel versions.

Adding Notes
Adding Notes

Function Buttons

As you see in the Mainline GUI, there are a few buttons available on the right side bar. They provide various functionalities to manage your kernels effectively.

Mainline Function Buttons
Mainline Function Buttons

Here is an explanation of each button:

  • Install: Downloads and installs the selected kernel.
  • Uninstall: Uninstalls the selected kernel. The currently running kernel and any locked kernels are protected and ignored.
  • PPA: Launches your default web browser to the webpage for the selected kernel. If no kernels are selected (e.g., when first launching the app before clicking on any), it launches the main page listing all the kernels. Use this to see the build summary and CHANGES files for the selected kernel.
  • Uninstall Old: Uninstalls all installed kernels below the latest installed version. The currently running kernel and any locked kernels are protected and ignored.
  • Reload: Deletes, re-downloads, and re-reads the local cached copies of all the index.html files from the mainline-ppa website, and regenerates the displayed list.
  • Settings: Accesses the settings dialog to configure various options for the Mainline application.
  • About: Displays basic information and credits for the Mainline application.
  • Exit: Closes the application.

By using these buttons, you can easily manage kernel installations, removals, and other configurations through the Mainline GUI.

It will also show you the version of currently running Kernel and the latest available Kernel at the bottom of the interface.

View Running and Latest Available Kernels
View Running and Latest Available Kernels

Sorting Columns

All column headers are clickable, enabling you to re-sort the list of kernels based on the selected column.

Kernel Column:

  • This column sorts using a special kernel version number sort.
  • Example: "1.2.3-rc3" is sorted higher than "1.2.3-rc2", but "1.2.3" is sorted higher than "1.2.3-rc3".

Lock Column:

  • Sorting on this column lets you see all locked kernels together.
  • Useful for managing and reviewing which kernels have been pinned/locked.

Status Column:

  • Sorting on this column displays all installed kernels together.
  • Helpful for quickly identifying which kernels are currently installed on your system.

Notes Column:

  • Sorting on this column brings all kernels with attached notes to the top.
  • This allows for easy access to kernels that have additional information documented.

Using these sorting features, you can efficiently manage and organize your kernel list.

Install Latest Mainline Linux Kernel on Ubuntu

If you want to install a kernel, simply click on it and click the Install button. Do not check the box. It is for locking the version. Just click on your preferred Kernel version and then click Install button.

Install Latest Mainline Linux kernel on Ubuntu
Install Latest Mainline Linux kernel on Ubuntu

Now the selected kernel will be downloaded along with its associated headers and modules and installed on your Linux system. You may need to enter your sudo password.

Installing Linux kernel 6.9.3 on Ubuntu
Installing Linux kernel 6.9.3 on Ubuntu

Once the installation is completed, click Close.

If you wish to boot into the newly installed Kernel, just reboot your system and choose the latest installed Kernel from the Grub boot menu.

Boot from Linux Kernel 6.9.3 in Ubuntu
Boot from Linux Kernel 6.9.3 in Ubuntu

After logging into the system, check your current Kernel version using command:

$ uname -mrs
Linux 6.9.3-060903-generic x86_64
Check Ubuntu Kernel Version
Check Ubuntu Kernel Version

Linux Kernel 6.8.0 is the default, official Kernel version included in the latest Ubuntu 24.04 LTS desktop:

$ uname -mrs
Linux 6.8.0-36-generic x86_64

Uninstall a Kernel

To uninstall a Kernel, simply choose it and click the Uninstall button.

Uninstall a Kernel
Uninstall a Kernel

You can also click the "Uninstall Old" which removes everything except the highest installed version currently running Kernel, and any Kernels that are locked.

Frequently Asked Questions (FAQ)

Q: What is Mainline?

A: Mainline is a tool for managing Ubuntu Mainline Kernel Builds on Debian-based distributions. It allows users to easily install, uninstall, and manage different kernel versions.

Q: How do I install Mainline?

A: You can install Mainline using the PPA:

sudo add-apt-repository ppa:cappelikan/ppa
sudo apt update
sudo apt install mainline

Alternatively, you can build Mainline from source by cloning the repository from GitHub and compiling it using the provided make commands.

Q: How do I use Mainline?

A: Mainline provides both a graphical user interface (GUI) and a command-line interface (CLI):
- GUI: Launch Mainline from your desktop's Applications/Start menu under "System -> Mainline Kernels".
- CLI: Use commands like mainline --help for options and mainline to interact with the tool from the command line.

Q: What features does Mainline offer?

A: Mainline allows you to:
- Install and uninstall selected kernel versions.
- Pin or lock kernels to prevent them from being altered or removed.
- Manage kernel notes and view PPA information directly.
- Customize settings and receive notifications about new kernel releases.

Q: How can I customize Mainline?

A: Mainline offers settings to configure various options such as external commands, notification preferences, and cache management. Access these settings through the GUI under the "Settings" button.

Q: What does locking a kernel do in Mainline?

A: Locking a kernel freezes it in its current state:
- Locked kernels cannot be installed, uninstalled, or affected by bulk operations like "Uninstall Old" or automatic notifications.
- They remain visible for reference and can be unlocked if needed.

Q: How does sorting work in Mainline?

A: You can sort the list of kernels by clicking on column headers:
- Kernel: Special sorting based on kernel version numbers.
- Lock: Group locked kernels together.
- Status: Arrange installed kernels for easy viewing.
- Notes: Bring kernels with attached notes to the top of the list.

Q: Is Mainline open-source?

A: Yes, Mainline is open-source and free to use. You can find its source code on GitHub, where contributions and community involvement are welcomed.


Mainline is a user-friendly GUI application for managing Ubuntu Mainline Kernel Builds on Debian-based systems. It offers easy installation and removal of kernels, customization options, and features like kernel locking.

Whether you're a beginner or an advanced user, Mainline provides a straightforward way to handle kernel updates and configurations.


You May Also Like

Leave a Comment

* By using this form you agree with the storage and handling of your data by this website.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

This website uses cookies to improve your experience. By using this site, we will assume that you're OK with it. Accept Read More