The Linux Kernel is the heart of any GNU/Linux operating system. It manages software and hardware communication and provides a platform for running applications. The default kernel provided with Ubuntu is suitable for most users but lacks some features and options available in other kernels. XanMod is a free, open-source alternative to the stock kernel with Ubuntu. It features custom settings and new features designed to provide a responsive and smooth desktop experience, especially for new hardware.
For users who would benefit the most from using XanMod, it is popular among Linux users who want better gaming performance, streaming quality, or 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. I would recommend 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. Ensure you disable it on your system.
In the following tutorial, you will learn how to install the latest XanMod Kernel on Ubuntu 22.04 or 20.04 LTS Linux desktop using the command line terminal and restore the original Ubuntu kernel if required.
Table of Contents
Recommended Steps Before Installation
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.
Before proceeding with the tutorial, ensuring your system is up-to-date with all existing packages is good.
sudo apt update
Optionally, you can list the updates for users who require review or are curious.
sudo apt --list upgradable
Proceed to upgrade any outdated packages using the following command.
sudo apt upgrade
Import the XanMod Repository on Ubuntu Linux
Install Required Packages
First, you will need to install the following software packages using the following command in your terminal.
sudo apt install dirmngr ca-certificates software-properties-common apt-transport-https dkms curl -y
The first task is to import the XanMod repository. This can be done in 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.
curl -fSsL https://dl.xanmod.org/gpg.key | sudo gpg --dearmor | sudo tee /usr/share/keyrings/xanmod.gpg > /dev/null
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:
joshua@ubuntu:~$ grep xanmod /etc/apt/sources.list.d/xanmod-kernel.list
deb [signed-by=/usr/share/keyrings/xanmod.gpg] http://deb.xanmod.org releases main
Next, update your APT repository source listing to reflect the new addition.
sudo apt update
The repository typically has newer packages for installed dependencies, as you may have noticed.
Before continuing, run the apt upgrade command.
sudo apt upgrade
Install XanMod Kernel on Ubuntu Linux
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 6.x, 7.x 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
Install XanMod edge (recommended for the latest kernel)
sudo apt install linux-xanmod-edge
Install XanMod RT
sudo apt install linux-xanmod-rt
Install XanMod RT Edge
sudo apt install linux-xanmod-rt-edge
Install XanMod LTS (Kernel 5.15 LTS)
sudo apt install linux-xanmod-lts
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.
Verify the kernel installed by using the following cat command.
cat /proc/version
Example output:
Linux version 6.0.9-x64v2-xanmod1 (root@mascote) (gcc-12 (Debian 12.2.0-9) 12.2.0, GNU ld (GNU Binutils for Debian) 2.39) #0~20221116.d9f29c5 SMP PREEMPT_DYNAMIC Wed Nov 16 14:20:27 UTC
Remember, the above is just an example output, most likely the kernel version will be newer.
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 Latest Official Microcodes
Intel:
sudo apt install intel-microcode iucode-tool
AMD:
sudo apt install amd64-microcode
Additional Commands & Tips
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
Remove XanMod Kernel
First, before you do any removal commands you should remove the repository that you imported with the following command.
sudo rm /etc/apt/sources.list.d/xanmod-kernel.list
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:
joshua@ubuntu:~$ dpkg --list | grep `uname -r`
ii linux-headers-6.0.9-x64v2-xanmod1 6.0.9-x64v2-xanmod1-0~20221116.d9f29c5 amd64 Linux kernel headers for 6.0.9-x64v2-xanmod1 on amd64
ii linux-image-6.0.9-x64v2-xanmod1 6.0.9-x64v2-xanmod1-0~20221116.d9f29c5 amd64 Linux kernel, version 6.0.9-x64v2-xanmod1
The names shown in the output are the ones you need to remove that involve the XanMod Kernel, which should be displayed only. Now, to blanket remove all traces of XanMod, the following command will match any kernel parts that contain XanMod which you can copy and paste into your terminal.
sudo apt autoremove linux-image-*.*.*-xanmod* linux-headers-*.*.*-xanmod*
Example output:
Now most users should have a kernel installed to fall back to, but you can install the generic Ubuntu kernel to ensure its installed to avoid issues on reboot. I would recommend running this command.
sudo apt install --install-recommends linux-generic
Now restart your PC to finalize the removal of XanMod.
reboot
Once you have returned to your system, verify the installation rollback.
cat /proc/version
Example output:
joshua@ubuntu:~$ cat /proc/version
Linux version 5.19.0-23-generic (buildd@lcy02-amd64-076) (x86_64-linux-gnu-gcc-12 (Ubuntu 12.2.0-3ubuntu1) 12.2.0, GNU ld (GNU Binutils for Ubuntu) 2.39) #24-Ubuntu SMP PREEMPT_DYNAMIC Fri Oct 14 15:39:57 UTC 2022
joshua@ubuntu:~$