Linux Kernel
The Linux kernel is the core of the operating system. It is responsible for managing hardware resources, running processes, and providing essential services to applications. The kernel is the first piece of software that runs when the system is booted and is responsible for initializing the hardware and starting the rest of the operating system.
Identifying the Kernel being used
This terminal command will give your system’s kernel information:
As seen in the above example, Manjaro is running kernel 6.6.40-1-MANJARO. The information given here is not arbitrary; each part of the kernel name identifies something about that kernel:
The 6 indicates the version
The 6 indicates the major revision
The 40 indicates the minor revision
The 1 indicates the revision of the Manjaro package
MANJARO indicates the specific distribution it is used for
Adding New Kernels
When listing a new kernel to be installed in the command, it is unnecessary to write the entire version number. For example, any version of Kernel 4.19 can be listed simply as linux419
, and any version of Kernel 4.14 can be listed as linux414
, and so on.
The optional rmc
(remove current) component is of vital importance. Using this will result in your existing kernel being deleted upon the installation of the new kernel. Otherwise, if it is not used, then the existing kernel will be kept and will be selectable alongside the new kernel at the boot screen. It is recommended, especially if updating to the latest bleeding-edge kernel, to keep your old one, even if only for a short time afterward. This is the safer option, and the old kernel can be easily removed when satisfied with the stability and functionality of the new one.
As an example, once the terminal is opened, the following command will install a new kernel (6.6) without deleting the existing kernel currently being used:
Otherwise, the following command will install a new kernel (6.9) to replace the existing kernel, which will be deleted:
Either way, Manjaro will automatically configure the new kernel for you, ready for immediate use. Once completed, close the terminal and re-boot the system for the change to take effect.
Removing Kernels
Where multiple kernels are present on your system, pacman can be used to remove them in the terminal. It may be necessary to delete a total of three elements of the kernel in total to completely remove it:
The kernel itself
The kernel's headers
The kernel's extra modules
Whether the headers and extra modules must be deleted depends on whether they have been installed.
To remove a kernel, use the following syntax:
Here is an example of removing kernel 5.0.17–1
To delete a kernel’s headers, the syntax is:
For example, to delete the headers of kernel version 5.0.x from the system, the following command would be entered:
To delete a kernel’s extra modules, the syntax is:
For example, to delete the extra modules of kernel version 5.0.x from the system, the following command would be entered:
To delete all elements of a kernel at the same time, where they are all present on your system, the syntax is:
For example, to completely remove all elements of kernel version 5.0.x, the following command would be entered:
Please note, however, that attempting to delete multiple elements at once if they are not present on your system will result in an error message before the operation itself is aborted. It is also valuable noting if Manjaro is being run in a virtual machine (e.g., Oracle Virtualbox), you may not be able to delete certain kernels if they contain elements important to the virtualization process itself.