LinuxCommandLibrary

mhwd-kernel

Install, remove Linux kernels

TLDR

List all available kernels

$ mhwd-kernel [[-l|--list]]
copy

List all installed kernels
$ mhwd-kernel [[-li|--listinstalled]]
copy

Install a kernel
$ sudo mhwd-kernel [[-i|--install]] [kernel]
copy

Remove a kernel
$ sudo mhwd-kernel [[-r|--remove]] [kernel]
copy

Install a kernel, replacing the currently running kernel
$ sudo mhwd-kernel [[-i|--install]] [kernel] rmc
copy

SYNOPSIS


mhwd-kernel [OPTION]
mhwd-kernel -i|--install <version>
mhwd-kernel -r|--remove <version>
mhwd-kernel -l|--list
mhwd-kernel -p|--prefer <version>
mhwd-kernel -h|--help

PARAMETERS

-i, --install <version>
    Installs the specified kernel version (e.g., linux515). This will also install associated headers and modules.

-r, --remove <version>
    Removes the specified kernel version (e.g., linux510) and its associated packages from the system.

-l, --list
    Lists all installed kernel versions and indicates other available kernels that can be installed.

-p, --prefer <version>
    Sets the given kernel version as the preferred one for booting, ensuring it appears as the default option in the GRUB boot menu.

-h, --help
    Displays the help message, showing usage instructions and available options, then exits.

DESCRIPTION

mhwd-kernel is a command-line utility specific to Manjaro Linux for simplified management of various Linux kernel versions. It allows users to easily install, remove, and list available kernels, as well as set a preferred kernel for booting. This tool is part of the Manjaro Hardware Detection (MHWD) suite, which aims to provide an intuitive way to handle hardware drivers and kernel installations, particularly beneficial for users who need to switch between different kernel series (e.g., LTS, real-time, or bleeding-edge) for compatibility, performance, or stability reasons. It abstracts the underlying package management (pacman) commands, ensuring all necessary kernel components (headers, modules, etc.) are installed or removed correctly.

CAVEATS

  • Manjaro Specific: This command is exclusive to Manjaro Linux and its derivatives; it will not work on other distributions.
  • Root Privileges: Most operations (install, remove, prefer) require root privileges (e.g., using sudo).
  • Kernel Version Format: The kernel version must be specified in the linuxXXX format (e.g., linux515, linux61). Using incorrect formats will lead to errors.
  • System Stability: Removing the currently running or the only installed kernel can render the system unbootable. Always ensure at least one stable kernel is present, preferably an LTS version.

WHY USE MHWD-KERNEL?

Manjaro often provides multiple kernel series (e.g., LTS, stable, real-time) to offer users flexibility. mhwd-kernel simplifies switching between these for better hardware compatibility, performance tuning, or troubleshooting. For instance, an older LTS kernel might offer better stability for legacy hardware, while a newer kernel might be required for the latest hardware.

BOOTLOADER UPDATE

After installing or removing kernels, mhwd-kernel usually triggers an update to the GRUB bootloader configuration automatically. However, in some rare cases, users might need to manually run sudo update-grub or sudo grub-mkconfig -o /boot/grub/grub.cfg to ensure the new kernel entries appear correctly in the boot menu.

HISTORY

Manjaro Linux, a distribution based on Arch Linux, was founded in 2011. The mhwd (Manjaro Hardware Detection) suite, including mhwd-kernel, was developed early in Manjaro's history to simplify hardware and kernel management. It addresses a common pain point for users who found Arch's manual approach to be too complex. It provides a user-friendly abstraction layer over pacman and mkinitcpio, making it easier for Manjaro users to manage proprietary drivers and multiple kernel versions without deep knowledge of the underlying Arch Linux system. Its development has focused on enhancing user experience and system stability through automated dependency handling for kernels and graphics drivers.

SEE ALSO

mhwd(8), pacman(8), dkms(8), grub-mkconfig(8)

Copied to clipboard