Skip to main content
How To

Install Mainline Linux Kernel in Ubuntu Command Line

Want to install the latest mainline Linux kernel in Ubuntu? Here's a handy utility that lets you easily install it.

Sagar Sharma

Ubuntu Handbook

Usually, you should stuck with the kernel version Ubuntu provides. However, if you have noticed a bug or some hardware not being supported with the current kernel version, you can try upgrading the kernel and use the latest one.

Yes! Ubuntu gives you the ability to install a newer mainline kernel. You can download your preferred version from the archive here and install the deb files.

However, there is an unofficial PPA that lets you install the newer kernel easily.

So in this guide, I will be covering:

  • Install the latest mainline kernel
  • Install the latest point release
  • Use old kernel by default for system boot

How to install mainline kernel in Ubuntu

To install the mainline kernel, you'd need a package named mainline.

But it is not available in the default repositories in Ubuntu so in that case, using PPA is the right choice when the package is not available in the default repository.

To add PPA for the mainline package, use the following command:

sudo add-apt-repository ppa:cappelikan/ppa

Now, use the following command to update the repository and install the mainline utility:

sudo apt update && sudo apt install mainline

Once you are done with the installation, you can check the available latest mainline and the point release using the following command:

mainline --check