How to Install XanMod Kernel on Debian Linux

XanMod replaces Debian’s stock kernel with one tuned for desktop responsiveness. If you play games through Steam or Lutris, produce audio with Ardour or REAPER, or want better network throughput on your home server, XanMod delivers measurable improvements over the generic kernel Debian ships by default. By the end of this guide, you’ll have a working XanMod installation with automatic updates through APT, verified BBR network optimization, and the right kernel variant selected for your CPU.

The kernel achieves these gains through scheduler optimizations that reduce input latency, CPU-specific compiler flags that take advantage of modern instruction sets, and Google’s BBRv3 congestion control algorithm for faster downloads on congested networks. These aren’t theoretical benefits. You’ll notice smoother framerates, lower audio latency, and faster large file transfers.

Check System Requirements

XanMod only runs on 64-bit (x86_64/amd64) systems and requires Secure Boot disabled in your BIOS/UEFI settings. The kernel lacks Microsoft’s UEFI key signatures, so systems with Secure Boot enabled will refuse to load it. Confirm your architecture before proceeding:

uname -m
x86_64

Proceed only if the output shows x86_64. ARM-based systems and 32-bit installations are not supported.

XanMod officially supports Debian 12 (Bookworm) and Debian 13 (Trixie). Earlier versions like Debian 11 (Bullseye) are not available in the repository. Keep in mind that NVIDIA drivers on Debian, VirtualBox, VMware, and other DKMS modules compile against specific kernel versions. When a new XanMod release arrives, these modules may need time to catch up. If you rely on external kernel modules, the LTS variant is a safer choice since it tracks older, well-tested kernel versions.

Choose Your Debian Kernel Option

Debian offers several kernel options beyond the default stable kernel, each targeting different use cases. Understanding the differences helps you select the kernel that matches your hardware requirements, performance goals, and stability needs.

Kernel OptionPrimary FocusBest ForTrade-offs
Debian Stock KernelStability and broad hardware supportServers, production systems, conservative users who prioritize reliability over featuresOlder versions, slower to receive new hardware support, conservative defaults
Mainline KernelLatest upstream features and driversBleeding-edge hardware support, testing upstream features, kernel developersRapid update cycle, less testing than Debian kernels, potential instability
Liquorix KernelDesktop responsiveness and low latencyAudio production, real-time applications, desktop users prioritizing responsivenessOptimized for desktop workloads only, Secure Boot unsupported, limited to x86_64
XanMod KernelPerformance optimization and gamingGaming rigs, multimedia workstations, home servers, Wine/Proton usersCustom patches may conflict with some hardware, Secure Boot unsupported

The Debian stock kernel prioritizes stability and thorough testing, making it ideal for servers and systems where reliability matters more than cutting-edge features. Mainline kernels track upstream development with minimal modifications, delivering the latest hardware support and features as they land in stable releases. Liquorix focuses on desktop responsiveness with low-latency optimizations from the ZEN patchset, while XanMod applies extensive performance patches targeting gaming, networking, and high-throughput workloads.

Production servers should favor Debian’s stock kernel for tested stability. Performance-focused kernels like XanMod and Liquorix trade thorough testing for cutting-edge optimizations, making them better suited for workstations, gaming systems, and non-critical machines where you can tolerate occasional instability in exchange for performance gains.

Update Debian Before XanMod Installation

Kernel installations depend on having current package metadata and libraries. Running a full system update first prevents dependency conflicts that can occur when older packages expect different kernel headers or build tools:

sudo apt update && sudo apt upgrade

While kernel changes are generally safe, having a recovery option provides peace of mind. Creating a system snapshot with Timeshift on Debian before proceeding lets you restore your system to its current state if you encounter boot issues or hardware incompatibilities. This is especially valuable if you use NVIDIA drivers or other third-party kernel modules that might not immediately support the new kernel.

Install Repository Management Prerequisites

Adding third-party repositories requires several tools that may not be present on minimal Debian installations. The following command installs everything needed to securely download and verify the XanMod repository:

sudo apt install ca-certificates curl gnupg lsb-release -y

Here’s what each package provides: curl downloads files from the web, gnupg handles cryptographic signature verification, ca-certificates contains the root certificates needed for HTTPS connections, and lsb-release detects your Debian version for automatic repository configuration. Most desktop installations already have these, but including them ensures the commands work on any Debian system.

Import the XanMod GPG Key and Repository

APT uses GPG signatures to verify that packages actually come from their claimed source and haven’t been tampered with. Before adding the XanMod repository, you need to import their signing key so APT can validate the packages. This guide uses the modern DEB822 format for repository configuration, which provides cleaner syntax and better maintainability than legacy .list files.

Import the XanMod GPG Key

Download the XanMod signing key and convert it to the binary format APT expects. The key gets stored in /etc/apt/keyrings/, which is the modern location for third-party repository keys. First, ensure the directory exists with proper permissions:

sudo install -m 0755 -d /etc/apt/keyrings

Now download and convert the key:

curl -fsSL https://dl.xanmod.org/archive.key | sudo gpg --dearmor -o /etc/apt/keyrings/xanmod-archive-keyring.gpg

After running the command, verify the key file exists and has the correct permissions. The file should be readable by all users but only writable by root:

ls -la /etc/apt/keyrings/xanmod-archive-keyring.gpg
-rw-r--r-- 1 root root 1183 Dec  2 12:00 /etc/apt/keyrings/xanmod-archive-keyring.gpg

Add the XanMod Repository

Now create the repository configuration file. The DEB822 format uses a structured layout with labeled fields instead of cramming everything onto one line. Each field defines a specific aspect of the repository: where to fetch packages, which Debian release they’re built for, and which GPG key to use for verification:

cat <<EOF | sudo tee /etc/apt/sources.list.d/xanmod-release.sources
Types: deb
URIs: https://deb.xanmod.org
Suites: $(lsb_release -sc)
Components: main
Signed-By: /etc/apt/keyrings/xanmod-archive-keyring.gpg
EOF

The $(lsb_release -sc) command runs during execution and inserts your Debian codename (either “bookworm” or “trixie”) automatically. This means the same command works on both Debian 12 and 13 without modification. The Signed-By field points to the GPG key you downloaded earlier, ensuring APT only accepts packages signed by XanMod’s official key.

Verify the Repository Configuration

Before proceeding, confirm the repository file was created correctly by viewing its contents:

cat /etc/apt/sources.list.d/xanmod-release.sources

On Debian 13 (Trixie), the output should look like this. If you’re on Debian 12, the Suites line will show “bookworm” instead:

Types: deb
URIs: https://deb.xanmod.org
Suites: trixie
Components: main
Signed-By: /etc/apt/keyrings/xanmod-archive-keyring.gpg

Update Package Lists

With the repository configured, refresh APT’s package database to include XanMod’s packages. This step downloads the package list from the new repository and merges it with your existing sources:

sudo apt update

Watch the output for lines mentioning deb.xanmod.org. Seeing these lines confirms APT successfully contacted the XanMod repository:

Get:1 https://deb.xanmod.org trixie InRelease [4909 B]
Get:2 https://deb.xanmod.org trixie/main amd64 Packages [32.0 kB]

To double-check that APT recognizes the XanMod packages, query a specific package. The output shows the available version and confirms the repository is working:

apt-cache policy linux-xanmod-x64v3
linux-xanmod-x64v3:
  Installed: (none)
  Candidate: 6.x.x-xanmod1-0
  Version table:
     6.x.x-xanmod1-0 500
        500 https://deb.xanmod.org trixie/main amd64 Packages

Identify Your CPU Architecture Level

Modern x86-64 processors have evolved through several generations, each adding new instruction sets that improve performance. XanMod takes advantage of this by offering kernels compiled for specific architecture levels (x86-64-v2, v3, or v4). Installing the version that matches your CPU allows the kernel to use newer, more efficient instructions instead of falling back to older, slower ones.

To determine your CPU’s architecture level, download and run XanMod’s official detection script. This script checks which instruction sets your processor supports:

wget https://dl.xanmod.org/check_x86-64_psabi.sh
chmod +x check_x86-64_psabi.sh
./check_x86-64_psabi.sh

The script outputs the highest architecture level your CPU supports:

CPU supports x86-64-v3

Note down this version number for the installation step. Most processors manufactured after 2015 support at least x86-64-v3, which includes CPUs like Intel Haswell and newer or AMD Excavator and newer. If the script reports v4, you can still install v3 packages since XanMod doesn’t currently offer v4 meta-packages for all variants. Older systems that only support v2 can still use XanMod, though with fewer optimizations. The LTS variant also offers v1 for very old CPUs (pre-2009) that lack newer instruction sets.

Install the XanMod Kernel

XanMod offers several kernel variants, each optimized for different use cases. Choosing the right one depends on your hardware, what software you run, and how much stability versus cutting-edge features you prefer. The table below summarizes each variant:

XanMod Kernel Variants

VariantKernel SeriesAvailable LevelsBest For
MAIN6.17 (latest stable)x64v2, x64v3Desktop users wanting latest features and optimizations
EDGE6.17 (bleeding edge)x64v2, x64v3Users who need newest drivers or hardware support
LTS6.12 (long-term)x64v1, x64v2, x64v3Production systems, DKMS module compatibility, older CPUs
RT6.12 (real-time)x64v2, x64v3Audio production, low-latency workloads

Recommended for most users: The MAIN variant offers the best balance of performance and stability for desktop use. However, if you use NVIDIA proprietary drivers, VirtualBox, or other software that compiles kernel modules, the LTS variant is a safer choice. External modules often lag behind the latest kernel releases, and LTS tracks an older, more widely-supported kernel series.

Install Your Chosen Variant

Select the install command that matches your chosen variant and CPU architecture level. Most users should start with MAIN on x86-64-v3.

MAIN (Recommended for most users)

# x86-64-v3 (Intel Haswell/AMD Excavator and newer, most systems from 2015+)
sudo apt install linux-xanmod-x64v3

# x86-64-v2 (Intel Nehalem/AMD Jaguar era, 2009-2013)
sudo apt install linux-xanmod-x64v2

EDGE (Bleeding-edge features and newest hardware support)

# x86-64-v3
sudo apt install linux-xanmod-edge-x64v3

# x86-64-v2
sudo apt install linux-xanmod-edge-x64v2

LTS (For NVIDIA drivers and DKMS compatibility)

Choose LTS if you rely on NVIDIA proprietary drivers, VirtualBox, or other software that compiles kernel modules. The older kernel series gives driver vendors time to release compatible versions.

# x86-64-v3
sudo apt install linux-xanmod-lts-x64v3

# x86-64-v2
sudo apt install linux-xanmod-lts-x64v2

# x86-64-v1 (pre-2009 CPUs lacking SSE4)
sudo apt install linux-xanmod-lts-x64v1

RT (Real-time for audio production)

The RT variant includes the PREEMPT_RT patch set for guaranteed low-latency response times. Choose this if you use DAWs like Ardour, Bitwig, or REAPER with JACK audio and need lower buffer sizes without xruns.

# x86-64-v3
sudo apt install linux-xanmod-rt-x64v3

# x86-64-v2
sudo apt install linux-xanmod-rt-x64v2

Install DKMS Build Dependencies (Optional)

DKMS (Dynamic Kernel Module Support) automatically recompiles external kernel modules whenever you install a new kernel. However, it needs the right compilers and development libraries to work. If you plan to use NVIDIA proprietary drivers, VirtualBox, or other software that builds kernel modules, install these dependencies now:

sudo apt install --no-install-recommends dkms libdw-dev clang lld llvm

XanMod kernels are compiled with Clang/LLVM rather than GCC, so having the same toolchain installed helps avoid compatibility issues when DKMS builds modules against the kernel headers.

Reboot to Activate the Kernel

The new kernel won’t take effect until you reboot. During installation, APT configured GRUB to boot the XanMod kernel by default, so a simple restart is all that’s needed:

sudo reboot

Your stock Debian kernel remains installed as a fallback. If anything goes wrong, you can select it from the GRUB boot menu.

Verify XanMod Kernel Installation

Once your system boots back up, verify that the XanMod kernel is actually running. The easiest way is to check the kernel version string, which should now include “xanmod” in the name:

cat /proc/version

A successful installation shows output similar to this, with “xanmod” appearing in the version string and your chosen architecture level (v2, v3) visible:

Linux version 6.17.10-x64v3-xanmod1 (kernel@xanmod.org) (clang version 19.1.7, LLD 19.1.7) #0 SMP PREEMPT_DYNAMIC

For a shorter output that’s easier to read, use uname -r instead:

uname -r
6.17.10-x64v3-xanmod1

Verify BBRv3 TCP Congestion Control

One of XanMod’s key features is Google’s BBRv3 congestion control algorithm, which is enabled by default. BBR (Bottleneck Bandwidth and Round-trip propagation time) improves network performance by estimating available bandwidth more accurately than traditional algorithms like CUBIC. To confirm BBR is active:

sysctl net.ipv4.tcp_congestion_control
net.ipv4.tcp_congestion_control = bbr

If you’re interested in learning more about how BBR works and how to verify its performance benefits, see our guide on how to enable BBR on Debian.

Verify with System Information Tools

System information tools like fastfetch or neofetch display the active kernel version along with other system details. If you have fastfetch installed, it provides a quick confirmation that XanMod is running:

fastfetch --logo none --structure Kernel
Kernel: 6.x.x-x64v3-xanmod1

The presence of “xanmod” in the kernel string confirms the custom kernel is active.

Manage XanMod Kernel

After installation, XanMod integrates with Debian’s package management system just like any other software. Updates, removal, and switching between variants all work through APT.

Update XanMod Kernel

New XanMod releases arrive through APT alongside your regular system updates. Running the standard upgrade command checks for new kernel versions and installs them if available:

sudo apt update && sudo apt upgrade

After upgrading, reboot to load the new kernel. The previous version remains installed as a fallback option in GRUB. For hands-off updates, consider configuring unattended upgrades on Debian to automatically install security patches.

Remove XanMod Kernel

If XanMod causes problems or you simply want to return to the stock Debian kernel, removal is straightforward. The key rule is that you cannot remove the kernel you’re currently running, so you’ll need to boot into an alternative kernel first.

The removal process permanently deletes XanMod kernel packages and configuration files. Ensure you have booted into a working stock kernel before proceeding, and verify you can access GRUB to select alternative kernels if needed.

Boot into the Stock Kernel

Restart your system and access the GRUB boot menu. On most systems, GRUB appears briefly during startup. If it doesn’t appear automatically, hold the Shift key during the BIOS/UEFI post screen. From the GRUB menu, select “Advanced options for Debian” and then choose a kernel entry without “xanmod” in the name.

List Installed XanMod Packages

Once you’ve booted into the stock kernel, verify which XanMod packages are installed. This helps confirm you’re removing everything:

dpkg -l | grep xanmod

The output lists all installed packages containing “xanmod” in their name, including the meta-package, kernel image, and headers.

Remove XanMod Kernel Packages

Remove all XanMod packages using wildcard patterns. The --purge flag removes configuration files along with the packages:

sudo apt remove --purge linux-xanmod-* linux-image-*-xanmod* linux-headers-*-xanmod*

APT shows you exactly what will be removed before proceeding. Review the list to confirm it only includes XanMod packages.

Remove the Repository and GPG Key

With the packages removed, clean up the repository configuration and signing key. Leaving these in place causes APT to continue checking for XanMod updates you no longer need:

sudo rm /etc/apt/sources.list.d/xanmod-release.sources
sudo rm /etc/apt/keyrings/xanmod-archive-keyring.gpg

Update GRUB and Reboot

Finally, refresh APT’s package lists (so it stops looking for XanMod packages) and regenerate the GRUB configuration to remove XanMod entries from the boot menu:

sudo apt update
sudo update-grub
sudo reboot

Verify Complete Removal

After rebooting, confirm XanMod is fully removed. First, check that no XanMod packages remain:

dpkg -l | grep xanmod

This command should produce no output. Next, verify you’re running the stock Debian kernel:

uname -r

The output should show a standard Debian kernel version without “xanmod” in the name, such as 6.1.0-28-amd64.

Troubleshoot XanMod Kernel Issues

While XanMod works well on most systems, some hardware combinations or software dependencies can cause problems. Below are solutions to the most common issues.

System Fails to Boot After Installation

If your system hangs during boot, shows a black screen, or kernel panics after installing XanMod, you can recover by booting the stock Debian kernel. GRUB keeps multiple kernel versions available specifically for situations like this:

  1. Restart your computer and hold Shift during the POST screen to force the GRUB menu to appear
  2. Select “Advanced options for Debian” from the menu
  3. Choose a kernel entry that doesn’t include “xanmod” in the version string
  4. Once booted, either remove XanMod entirely using the steps above, or try the LTS variant which uses an older, more compatible kernel

NVIDIA Driver or DKMS Module Fails to Build

External kernel modules like NVIDIA proprietary drivers compile against specific kernel headers. When you install a new kernel, DKMS attempts to rebuild these modules automatically. If this fails, you’ll typically see an error during boot or when running nvidia-smi:

Error! Bad return status for module build on kernel: 6.17.10-x64v3-xanmod1
Consult /var/lib/dkms/nvidia/550.78/build/make.log for more information.

First, check which modules are in a failed state:

dkms status

Modules showing “installed” are working; those showing “built” or “added” without an installed entry for your current kernel need attention. Install the build dependencies and force a rebuild of all modules:

sudo apt install --no-install-recommends dkms libdw-dev clang lld llvm
sudo dkms autoinstall

After the rebuild completes, verify all modules are now installed for your kernel:

dkms status

Each module should show “installed” for your XanMod kernel version. For NVIDIA specifically, confirm the driver loads:

nvidia-smi

When the rebuild still fails, the module likely doesn’t support the kernel version you’re running. This is common with bleeding-edge kernels like MAIN or EDGE. In that case, switch to the XanMod LTS variant, which tracks kernel 6.12. This older kernel series has had time for driver vendors to release compatible versions.

Repository Update Errors

If apt update fails with errors referencing the XanMod repository, you might see messages like:

E: The repository 'https://deb.xanmod.org bullseye Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.

The most likely cause is running an unsupported Debian version. Verify your release codename:

lsb_release -sc

Only bookworm (Debian 12) and trixie (Debian 13) are supported. XanMod doesn’t provide packages for older releases like bullseye (Debian 11) or buster (Debian 10). Running an older version means you’ll need to upgrade Debian before using XanMod.

Another common cause is network connectivity issues or temporary server problems. Wait a few minutes and try sudo apt update again. If the problem persists, check the XanMod website for any announcements about repository maintenance.

Secure Boot Prevents Kernel from Loading

If your system boots directly into the stock Debian kernel after installing XanMod, or you see “Secure Boot violation” errors, Secure Boot is blocking the unsigned XanMod kernel. To resolve this, access your system’s BIOS/UEFI settings during startup (typically by pressing Del, F2, or F12 depending on your motherboard) and disable Secure Boot. The exact menu location varies by manufacturer, but it’s usually under “Security” or “Boot” settings.

After disabling Secure Boot, save your BIOS settings and reboot. GRUB should now load the XanMod kernel without issues. Keep in mind that disabling Secure Boot reduces protection against certain boot-level malware, though this is primarily a concern for high-security environments rather than typical desktop use.

Some UEFI firmware includes an “Enroll Efi Image” option that lets you add unsigned kernels to a trusted list without fully disabling Secure Boot. This feature is hardware-specific and requires re-enrolling after every kernel update. If you prefer keeping Secure Boot enabled, check your motherboard’s UEFI settings for this option, but be aware it’s not universally available and adds maintenance overhead.

Conclusion

Your Debian system is now running the XanMod kernel with BBRv3 network optimization, improved scheduler performance, and CPU-specific tuning. Future kernel updates arrive automatically through APT whenever XanMod releases new versions. For systems that rely on NVIDIA drivers or other external kernel modules, switching to the LTS variant prevents compatibility issues while still providing XanMod’s core improvements. Check the official XanMod website periodically for release notes and information about new features.

Leave a Comment