Skip to content

Arch Linux Kernel Management

Mattscreative edited this page Nov 19, 2025 · 2 revisions

⚙️ Arch Linux Kernel Management Guide

Complete beginner-friendly guide to managing kernels on Arch Linux, including installation, removal, switching, and custom kernels.


📋 Table of Contents

  1. Understanding Kernels
  2. Available Kernels
  3. Installing Kernels
  4. Removing Kernels
  5. Switching Kernels
  6. Kernel Parameters
  7. Custom Kernels
  8. Troubleshooting

🎯 Understanding Kernels

What is a Kernel?

Kernel is the core of the operating system.

Functions:

  • Manages hardware
  • Handles system resources
  • Provides system calls
  • Controls processes

Kernel Versions

Version format:

6.6.0-arch1
│ │ │ └─── Arch build number
│ │ └───── Patch version
│ └─────── Minor version
└───────── Major version

Kernel Types

Different kernel types:

  • Stable: Latest stable kernel
  • LTS: Long-term support
  • Hardened: Security-focused
  • Zen: Performance-optimized
  • Custom: User-compiled

📦 Available Kernels

Official Kernels

Available in repositories:

  • linux: Latest stable kernel
  • linux-lts: Long-term support kernel
  • linux-hardened: Security-hardened kernel
  • linux-zen: Performance-optimized kernel

Check Installed Kernels

List installed kernels:

# List installed kernels
pacman -Q | grep linux

# Check running kernel
uname -r

Expected output:

linux 6.6.0.arch1-1
linux-headers 6.6.0.arch1-1
linux-firmware 20231215.1b8c0c0-1

📥 Installing Kernels

Install Stable Kernel

Install latest kernel:

# Install kernel
sudo pacman -S linux linux-headers

# For firmware
sudo pacman -S linux-firmware

What gets installed:

  • Kernel image (vmlinuz-linux)
  • Kernel headers (for building modules)
  • Kernel modules

Install LTS Kernel

Install long-term support:

# Install LTS kernel
sudo pacman -S linux-lts linux-lts-headers

Why LTS:

  • More stable
  • Longer support
  • Better for servers
  • Fewer updates

Install Multiple Kernels

Install both stable and LTS:

# Install both
sudo pacman -S linux linux-lts linux-headers linux-lts-headers

Benefits:

  • Fallback option
  • Test new kernel
  • Keep stable option

Install Hardened Kernel

Security-focused kernel:

# Install hardened kernel
sudo pacman -S linux-hardened linux-hardened-headers

Features:

  • Enhanced security
  • Kernel hardening
  • Security patches

Install Zen Kernel

Performance-optimized:

# Install Zen kernel
sudo pacman -S linux-zen linux-zen-headers

Features:

  • Performance tweaks
  • Better desktop responsiveness
  • Optimized for gaming

🗑️ Removing Kernels

Remove Kernel

Remove specific kernel:

# Remove kernel
sudo pacman -R linux

# Remove with headers
sudo pacman -R linux linux-headers

⚠️ Warning: Don't remove the kernel you're currently using!

Check Running Kernel

Before removing:

# Check current kernel
uname -r

# List installed kernels
pacman -Q | grep linux

Only remove kernels you're not using.

Clean Old Kernels

Remove old kernel versions:

# List old kernels
pacman -Q | grep linux | grep -v $(uname -r)

# Remove old kernels (be careful!)
sudo pacman -R old-kernel-name

🔄 Switching Kernels

GRUB Boot Menu

Switch at boot:

  1. Reboot system
  2. Press key when GRUB menu appears
  3. Select kernel from menu
  4. Boot into selected kernel

Set Default Kernel

For GRUB:

# Edit GRUB config
sudo vim /etc/default/grub

Set default:

GRUB_DEFAULT="Advanced options for Arch Linux>Arch Linux, with Linux linux-lts"

Regenerate:

sudo grub-mkconfig -o /boot/grub/grub.cfg

systemd-boot

Edit boot entry:

# Edit entry
sudo vim /boot/loader/entries/arch-lts.conf

Change kernel:

linux /vmlinuz-linux-lts
initrd /initramfs-linux-lts.img

⚙️ Kernel Parameters

What are Kernel Parameters?

Kernel parameters configure kernel at boot.

Common parameters:

  • quiet: Suppress boot messages
  • splash: Show splash screen
  • nomodeset: Disable KMS
  • acpi=off: Disable ACPI

Adding Parameters

For GRUB:

# Edit GRUB config
sudo vim /etc/default/grub

Add parameters:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nomodeset"

Regenerate:

sudo grub-mkconfig -o /boot/grub/grub.cfg

For systemd-boot

Edit boot entry:

sudo vim /boot/loader/entries/arch.conf

Add to options:

options root=UUID=xxxx-xxxx-xxxx rw quiet splash

Common Parameters

Useful parameters:

  • quiet: Less verbose boot
  • splash: Boot splash
  • nomodeset: Disable KMS (for NVIDIA)
  • acpi=off: Disable ACPI
  • iommu=on: Enable IOMMU
  • mitigations=off: Disable security mitigations (performance)

🔨 Custom Kernels

Why Custom Kernel?

Reasons:

  • Remove unused features
  • Add specific features
  • Optimize for hardware
  • Reduce size

Building Custom Kernel

Install build tools:

# Install base-devel
sudo pacman -S base-devel

# Install kernel build tools
sudo pacman -S asp

Get kernel source:

# Get kernel package
asp checkout linux

# Or download from kernel.org
wget https://www.kernel.org/pub/linux/kernel/v6.x/linux-6.6.tar.xz

Configure kernel:

# Copy config
cp /proc/config.gz .
gunzip config.gz
cp config .config

# Or use default
make defconfig

# Customize
make menuconfig

Build kernel:

# Build kernel
make -j$(nproc)

# Install modules
sudo make modules_install

# Install kernel
sudo make install

⚠️ Advanced: Only for experienced users!


🔧 Troubleshooting

Kernel Panic

If system won't boot:

  1. Boot from USB
  2. Chroot into system
  3. Install different kernel
  4. Reboot

Module Issues

Rebuild modules:

# Rebuild modules
sudo depmod -a

# Load module
sudo modprobe module-name

Kernel Not Found

Reinstall kernel:

# Reinstall kernel
sudo pacman -S linux linux-headers

# Regenerate initramfs
sudo mkinitcpio -P

Boot Issues

Regenerate initramfs:

# Regenerate for all kernels
sudo mkinitcpio -P

# For specific kernel
sudo mkinitcpio -p linux

📝 Summary

This guide covered:

  1. Kernel basics - What kernels do
  2. Available kernels - Types of kernels
  3. Installing - How to install kernels
  4. Removing - How to remove kernels
  5. Switching - Change kernels
  6. Parameters - Kernel boot options
  7. Custom kernels - Building kernels
  8. Troubleshooting - Common issues

Key Takeaways:

  • Multiple kernels can coexist
  • LTS is more stable
  • Don't remove running kernel
  • Kernel parameters customize boot
  • Custom kernels are advanced

🔗 Next Steps


This guide is based on the ArchWiki. For the most up-to-date information, always refer to the official ArchWiki.

Clone this wiki locally