How to Install XanMod Kernel on Ubuntu 22.04 LTS

XanMod is a free, open-source general-purpose Linux Kernel alternative to the stock kernel with Ubuntu 22.04. It features custom settings and new features and is built to provide a responsive and smooth desktop experience, especially for new hardware.

XanMod is popular amongst Linux Gaming, streaming, and ultra-low latency requirements and often boasts the latest Linux Kernels before landing on most distributions. Most desktop users are not even into gaming but want a new kernel for better hardware support, making XanMod one of the more popular choices.

For more information on XanMod Kernel before installing, visit the XanMod Kernel features information page.

XanMod Kernel only supports x86_64 processor architecture.

XanMod Kernel DOES NOT support secure boot.

In the following tutorial, you will learn how to install the latest XanMod Kernel on Ubuntu 22.04 LTS Jammy Jellyfish using the command line terminal and restore the original Ubuntu kernel if required.

Update Ubuntu

Before you begin, run an update on your system to ensure all packages are up-to-date to avoid any conflicts during the installation of XanMod, this is critical given you are installing a kernel.

sudo apt update && sudo apt upgrade -y

Install Required Packages

To complete the installation, you will need to install the following software packages by using the following command in your terminal.

sudo apt install software-properties-common apt-transport-https wget ca-certificates gnupg2 ubuntu-keyring -y

Import the XanMod Repository

The first task is to import the XanMod repository. This can be done several ways, but the tutorial will use the apt package manager’s terminal to simplify things.

First, import the GPG key using the following command.

sudo wget -O- https://dl.xanmod.org/gpg.key | gpg --dearmor | sudo tee /usr/share/keyrings/xanmod.gpg

Next, import the repository using the following command.

echo 'deb [signed-by=/usr/share/keyrings/xanmod.gpg] http://deb.xanmod.org releases main' | sudo tee /etc/apt/sources.list.d/xanmod-kernel.list

Verify the command worked using the grep command.

grep xanmod /etc/apt/sources.list.d/xanmod-kernel.list

Example output:

deb http://deb.xanmod.org releases main

Example output if successful:

OK

Next, update your APT repository source listing to reflect the new addition.

sudo apt update

The repository typically has newer packages for dependencies already installed, as you may have noticed.

Before continuing, run the apt upgrade command.

sudo apt upgrade

Install XanMod Kernel

With the XanMod repository installed and up to date, you can install the Linux kernel from XanMod. These Linux Kernel versions will change to Linux Kernel 5.17, 5.18, 5.19, etc.

The tutorial will go over installing all three, but it’s recommended to stick to stable and edge, do not use development unless you know what you are doing.

Install XanMod stable:

sudo apt install linux-xanmod
sudo apt install linux-xanmod-edge

Install XanMod development:

sudo apt install linux-xanmod-tt

Example output from (edge):

Type Y, then press the ENTER KEY to proceed with the installation.

Once the chosen repository Linux kernel has been installed, you will need to reboot your system to complete the installation.

reboot

Once you have returned to your system, verify the installation.

At the time of the tutorial, the edge branch contained Linux kernel 5.16, but this will change almost the same day when a new Linux kernel is released, such as Linux kernel 5.17, 5.18, 5.19, 5.20, and so on.

Verify the kernel installed by using the following cat command.

cat /proc/version

Example output:

Install XanMod Kernel on Ubuntu 22.04 LTS

Alternatively, install Neofetch to print out your system specs.

sudo apt install neofetch -y

Next, use the neofetch command to print your system specs to reveal the kernel version.

neofetch

Example output:

Install XanMod Kernel on Ubuntu 22.04 LTS

Update XanMod Kernel

To keep the Linux kernel you installed with XanMod up to date, you will run the standard apt update and upgrade commands if you installed XanMod using APT, which the tutorial has shown.

To check for updates.

sudo apt update

If an upgrade is available.

sudo apt upgrade

How to Remove (Uninstall) XanMod Kernel

To remove XanMod, use the following command.

Remove XanMod stable:

sudo apt autoremove linux-xanmod --purge -y

Remove XanMod edge:

sudo apt autoremove linux-xanmod-edge --purge -y

Remove XanMod development:

sudo apt autoremove linux-xanmod-tt --purge -y

Ideally, you can remove the repository as well.

sudo rm /etc/apt/sources.list.d/xanmod-kernel.list

Once you reboot your system, you will find that the XanMod kernel is still around.

Use the following steps, which you can do before rebooting your machine, to begin with.

First, we need to use the exact name of the Linux image and header package of XanMod.

This can be found by using the following dpkg –list command.

dpkg --list | grep `uname -r`

Example output:

Install XanMod Kernel on Ubuntu 22.04 LTS

The names shown in the output are the ones you need to remove that involve the XanMod Kernel, which should be displayed only.

Example only:

sudo apt autoremove linux-image-5.16.7-xanmod1 linux-headers-5.16.7-xanmod1

Remember to replace the 5.16.7 with the version printed out in the dpkg –list command.

Alternatively, you could take a shortcut using this command, but be careful not to remove any existing kernels.

sudo apt autoremove linux-image-5.*.*-xanmod1 linux-headers-5.*.*-xanmod1

Example output:

Install XanMod Kernel on Ubuntu 22.04 LTS

Type Y, then press the ENTER KEY to proceed with the removal.

Next, update-grub and initramfs.

sudo update-grub && sudo update-initramfs -u

This should result in the original Linux Kernel present in the output terminal messages.

Example output:

update-initramfs: Generating /boot/initrd.img-5.15.0-18-generic

Now restart your PC to finalize the removal of XanMod.

sudo reboot

Once you have returned to your system, verify the installation rollback.

cat /proc/version

Example output:

Install XanMod Kernel on Ubuntu 22.04 LTS

For users that installed Neofetch, use the command to print out your system specs again.

neofetch

Example output:

Install XanMod Kernel on Ubuntu 22.04 LTS

As shown above, you have rolled back to the default Linux kernel, thus successfully removing XanMod from your system in full.

Comments and Conclusion

In the tutorial, you have learned how to install XanMod on Ubuntu 22.04 LTS Jammy Jellyfish.

XanMod is designed for desktop users with the latest hardware, but this can be installed on any Ubuntu desktop currently supported. However, it is advised to research before upgrading, and it is ill-advised to use it on critical or production-type systems.

One of the best features of using XanMod is that when the next Linux Kernel comes around, it is included on development/edge very quickly. Hence, it is worth the look, especially if you are into Linux gaming.



Follow LinuxCapable.com!

Like to get automatic updates? Follow us on one of our social media accounts!