How To Install a Mainline Linux Kernel in Ubuntu

Note: This article was updated on Thursday, July 31st, 2025 and will work with newer Ubuntu releases.

By default, Ubuntu systems run with the Ubuntu kernels provided by the Ubuntu repositories. To get unmodified upstream kernels that have new features or to confirm that upstream has fixed a specific issue, we often need to install the mainline Kernel. The mainline kernel is the most recent version of the Linux kernel released by the Linux Kernel Organization. It undergoes several stages of development, including merge windows, release candidates, and final releases. Mainline kernels are designed to offer the latest features and improvements, making them attractive to developers and power users. Kernel.org lists the available Kernel versions.

To install the mainline kernel, we need a package called mainline available from the cappelikan personal package archive (PPA). To add PPA for the mainline package, use the following command:

sudo add-apt-repository ppa:cappelikan/ppa

Ensure pkexec is installed:

sudo apt install pkexec

Run the following commands to update the repository and install the mainline utility:

sudo apt update
sudo apt install mainline

Once installed, we can check the available latest mainline and the point release using the following command:

mainline --check

For example, the latest stable kernel at the time of writing this article was 6.2.12.

$ sudo mainline --check
mainline 1.2.5
Distribution: Ubuntu 22.04.2 LTS
Architecture: amd64
Running kernel: 5.15.0-43-generic
Updating from: 'https://kernel.ubuntu.com/~kernel-ppa/mainline/'
OK
Fetching individual kernel indexes...
Found installed : 5.15.0-43.46
Latest update: 6.2.12
Latest point update: 5.15.108
----------------------------------------------------------------------

If you want the very latest unstable mainline, add --include-unstable to the command, eg:

# mainline --check --include-unstable
mainline 1.2.5
Distribution: Ubuntu 22.04.2 LTS
Architecture: amd64
Running kernel: 5.15.0-43-generic
Updating from: 'https://kernel.ubuntu.com/~kernel-ppa/mainline/'
OK
Fetching individual kernel indexes...
Found installed : 5.15.0-43.46
Latest update: 6.3.0-rc7
Latest point update: 5.15.108
----------------------------------------------------------------------

We see Kernel 6.3.0-rc7 is available.

Installing the latest mainline kernel

To install the latest stable kernel (6.2.12 in our example), all you have to do is run the following command:

$ sudo mainline --install-latest

To install the latest point Kernel (5.15.0-43.46), run the following command:

$ sudo mainline --install-point

To install the latest unstable Kernel (6.3.0-rc7), run the following command:

$ sudo mainline --install 6.3.0-rc7

For more information and options run mainline --help

$ mainline --help
mainline 1.2.5
Distribution: Ubuntu 22.04.2 LTS
Architecture: amd64
Running kernel: 5.15.0-43-generic
  
mainline 1.2.5 - Ubuntu Mainline Kernel Installer
  
Syntax: mainline <command> [options]
  
Commands:
  
--check Check for kernel updates
--notify  Check for kernel updates and notify current user
--list  List all available mainline kernels
--list-installed  List installed kernels
--install-latest  Install latest mainline kernel
--install-point Install latest point update for current series
--install <name>  Install specified mainline kernel(1)(3)
--uninstall <name>  Uninstall specified kernel(1)(2)(3)
--uninstall-old Uninstall all but the highest installed version(3)
--download <name> Download specified kernels(2)
--delete-cache  Delete cached info about available kernels
  
Options:
  
--include-unstable  Include unstable and RC releases
--exclude-unstable  Exclude unstable and RC releases
--debug Enable verbose debugging output
--yes Assume Yes for all prompts (non-interactive mode)
  
Notes:
(1) A version string taken from the output of --list
(2) One or more, comma-seperated
(3) The currently running kernel will always be ignored

Once the Kernel is installed, reboot

$ sudo systemctl reboot

When the system boots, verify the new Kernel is loaded

$ uname -r
6.3.0-060300rc7-generic

Enjoy

Using Linux Kernel Memory Tiering

Using Linux Kernel Memory Tiering

In this post, I’ll discuss what memory tiering is, why we need it, and how to use the memory tiering feature available in the mainline v5.15 Kernel.

What is Memory Tiering?

With the advent of various new memory types, some systems will have multiple types of memory, e.g. High Bandwidth Memory (HBM), DRAM, Persistent Memory (PMem), CXL and others. The Memory Storage hierarchy should be familiar to you.

Memory Storage Hierarchy

Read More
How To Enable Debug Logging in ipmctl

How To Enable Debug Logging in ipmctl

The ipmctl utility is used for configuring and managing Intel Optane Persistent Memory modules (DCPMM/PMem). It supports the functionality to:

  • Discover Persistent Memory on the server
  • Provision the persistent memory configuration
  • View and update the firmware on the persistent memory modules
  • Configure data-at-rest security
  • Track health and performance of the persistent memory modules
  • Debug and troubleshoot persistent memory modules

I wrote the IPMCTL User Guide showing how to use the tool, but what if ipmctl returns an error or something you’re not expecting? How do you debug the debugger? On Linux, ipmctl relies on libndctl to help perform communication to the BIOS and persistent memory modules themselves. This is a complicated stack involving multiple kernel drivers and the physical hardware itself. Anything along this path could be causing a problem.

Read More
50 Generative AI Prompts I use as a Product Manager to Improve Efficiency and Product Quality

50 Generative AI Prompts I use as a Product Manager to Improve Efficiency and Product Quality

As a product manager, the success of our products depends on our ability to make informed, strategic decisions quickly and efficiently. In the fast-paced world of the IT industry, it’s crucial to stay ahead of trends, understand our customers deeply, and align our product development with our business goals. This is where generative AI and a well-crafted set of prompts have become invaluable tools in my daily workflow.

Why I Use These Prompts Daily

Every day, I’m faced with decisions that can significantly impact the trajectory of our product roadmap, customer satisfaction, and ultimately, our bottom line. The prompts I use are not just about generating ideas but about driving actionable insights that are tailored to our specific needs. These prompts cover a wide range of product management aspects—from prioritizing features based on customer feedback to crafting a go-to-market strategy that aligns with our business objectives.

Read More