DEV Community

Kb Bohara
Kb Bohara

Posted on

How to Change / Update the Kernel in Linux (systemd-boot) baby

Arch Linux provides multiple kernel options, and with systemd-boot.

1️⃣ Check Your Current Kernel

Before switching kernels, verify which kernel you're using:

uname -r
# output: 6.13.2-arch1-1
# This means you are running the **latest Arch Linux kernel**.
Enter fullscreen mode Exit fullscreen mode

2️⃣ Install a New Kernel

Arch Linux offers various kernel options:

Kernel Type Package Name Purpose
Latest Stable Kernel linux Default, rolling release
LTS (Long-Term Support) linux-lts More stable, recommended for production
Hardened Kernel linux-hardened Security-focused
Zen Kernel linux-zen Performance optimized

Install the LTS Kernel

If you prefer a more stable setup:

sudo pacman -S linux-lts linux-lts-headers
Enter fullscreen mode Exit fullscreen mode

Other Kernel Options

  • Hardened Kernel:
  sudo pacman -S linux-hardened
Enter fullscreen mode Exit fullscreen mode
  • Zen Kernel:
  sudo pacman -S linux-zen
Enter fullscreen mode Exit fullscreen mode

3️⃣ Verify Kernel Installation

Once installed, check if the new kernel appears in /boot:

ls /boot
Enter fullscreen mode Exit fullscreen mode

You should see files like:

 EFI                            initramfs-linux-lts-fallback.img   initramfs-linux.img   vmlinuz-linux
 initramfs-linux-fallback.img   initramfs-linux-lts.img            loader                vmlinuz-linux-lts
Enter fullscreen mode Exit fullscreen mode

4️⃣ Configure systemd-boot

🔹 Check Available Boot Entries

ls /boot/loader/entries/
Enter fullscreen mode Exit fullscreen mode

You should see something like:

arch.conf 
Enter fullscreen mode Exit fullscreen mode

If arch-lts.conf is missing, you need to create it.

🔹 Create a Boot Entry for Linux-LTS

  1. Manually create the entry file:
   sudo vim /boot/loader/entries/arch-lts.conf
Enter fullscreen mode Exit fullscreen mode
  1. Add the following content:
   title   Arch Linux LTS
   linux   /vmlinuz-linux-lts
   initrd  /initramfs-linux-lts.img
   options root=UUID=<your-root-partition-uuid> rw quiet splash
Enter fullscreen mode Exit fullscreen mode

Find your root partition UUID using:

   lsblk -o NAME,MOUNTPOINTS,UUID
Enter fullscreen mode Exit fullscreen mode
  1. Save and exit esc:wq.

5️⃣ Set Default Kernel (Optional)

If you want linux-lts to be the default kernel:

  1. Open systemd-boot loader config:
   sudo vim /boot/loader/loader.conf
Enter fullscreen mode Exit fullscreen mode
  1. Change the default entry:
   default arch-lts.conf
   timeout 3
Enter fullscreen mode Exit fullscreen mode
  1. Save the file and reboot.

6️⃣ Reboot & Select Kernel

Restart your system:

sudo reboot
Enter fullscreen mode Exit fullscreen mode

At the systemd-boot menu, you should now see Arch Linux LTS listed. Select it to boot.


7️⃣ Verify the Running Kernel

After booting, check if you're using the new kernel:

uname -r
Enter fullscreen mode Exit fullscreen mode

If you installed linux-lts, the output should be something like:

6.12.x-lts
Enter fullscreen mode Exit fullscreen mode

8️⃣ Remove Old Kernel (Optional)

If you no longer need the old kernel:

sudo pacman -R linux
Enter fullscreen mode Exit fullscreen mode

Then update systemd-boot:

bootctl update
Enter fullscreen mode Exit fullscreen mode

Top comments (0)