How to Switch Arch Linux Kernels
Whatever your reasoning may be switching your kernel in Arch Linux is actually a fairly easy process. All we need to do is make sure the proper kernel is installed on your system and config grub to easily utilize that new kernel.
You can check your currently installed Kernel and version with the command below.
First, lets take a look at our options from the official Arch wiki.
Officially Supported Kernels
- Stable — Vanilla Linux kernel and modules, with a few patches applied.
https://www.kernel.org/ || linux
- Hardened — A security-focused Linux kernel applying a set of hardening patches to mitigate kernel and userspace exploits. It also enables more upstream kernel hardening features than linux.
https://github.com/anthraxx/linux-hardened || linux-hardened
- Longterm — Long-term support (LTS) Linux kernel and modules.
https://www.kernel.org/ || linux-lts
- Zen Kernel — Result of a collaborative effort of kernel hackers to provide the best Linux kernel possible for everyday systems. Some more details can be found on https://liquorix.net (which provides kernel binaries based on Zen for Debian).
https://github.com/zen-kernel/zen-kernel || linux-zen
Above we have listed the package names that you will want to install. Once you deiced the kernel you would like on your system, run one of the following commands.
sudo pacman -S linux
sudo pacman -S linux-zen
sudo pacman -S linux-lts
sudo pacman -S linux-hardened
Selecting the kernel is done when you boot your system though GRUB. We are going to change some setting in the configuration so that way you will see all avalible kernel without needing to go into advanced setting and it will save your selection for whne you boot in the future.
Open the GRUB condifuration in nano.
sudo nano /etc/default/grub
Next we will change the following options. Depending on the Arch-based distibution you are using these setting may be in different orders, already set properly, or may need uncommented.
GRUB_DEFAULT – Default boot selection.
GRUB_SAVEDEFAULT – GRUB to remember the last selection.
GRUB_DISABLE_SUBMENU – Disable submenus.
GRUB_DEFAULT=saved GRUB_SAVEDEFAULT=true GRUB_DISABLE_SUBMENU=y
Setting GRUB_DEFAULT as saved will set the last used selection as the default keneral to boot. After you make these edits make sure you press Ctrl-O when in nano and write out your changes.
Reloading GRUB Configuration
Type the following command to reload the grub configuration with your saved changes.
sudo grub-mkconfig -o /boot/grub/grub.cfg
Now all you need to do is reboot your system and select the kernel you would like on boot. Enjoy!
One thing I forgot to mention in the video; you should install the corresponding *-headers packages that goes with your kernel.
sudo pacman -S linux-headers
sudo pacman -S linux-zen-headers
sudo pacman -S linux-lts-headers
sudo pacman -S linux-hardened-headers
Zen kernel LAN issue: https://forum.endeavouros.com/t/linux-zen-kernel-internet-not-working/6339