Manjaro Difference between revisions of "Manjaro Kernels"

Difference between revisions of "Manjaro Kernels"

From Manjaro
imported>Handy
m
 
(37 intermediate revisions by 14 users not shown)
Line 1: Line 1:
= Overview =
<languages/>


As the name would imply, as with the kernel of a seed, the Linux kernel is the core of a Linux operating system. Every other element of a Linux-based operating system is built around the kernel, which acts as an interface between your computer's hardware and the applications that run on it. As hardware and software applications become more complex and sophisticated, so do the kernels to fully utilise them. As such, Linux kernels are continually under development, with new revisions and versions being regularly released. Further information on the very latest developments in kernel technology can be found at [http://www.kernel.org/ The Linux Kernel Archives]
__TOC__


The first Linux kernel was originally developed by [http://en.wikipedia.org/wiki/Linus_Torvalds Linus Torvalds], the creator of Linux. As an open source project, although modern kernels now contain millions of lines of code generated by thousands of programmers, Linus Torvalds still has the final authority on their development and release.
<translate>
= Overview = <!--T:1-->


<!--T:2-->
As the name would imply, as with the kernel of a seed, the Linux kernel is the core of a Linux operating system. Every other element of a Linux-based operating system is built around the kernel, which acts as an interface between your computer's hardware and the applications that run on it. As hardware and software applications become more complex and sophisticated, so do the kernels to fully utilise them. As such, Linux kernels are continually under development, with new revisions and versions being regularly released. Further information on the very latest developments in kernel technology can be found at [http://www.kernel.org/ The Linux Kernel Archives].


= Identifying the Kernel Being Used =
<!--T:3-->
The first Linux kernel was originally developed by [http://en.wikipedia.org/wiki/Linus_Torvalds Linus Torvalds], the creator of Linux. It is now an open-source project containing millions of lines of code generated by thousands of programmers.  However, Linus Torvalds still has the final authority on their development and release.


If the existing Kernel being run in Manjaro is not immediately apparent (i.e. through the pre-installed ''Conky'' display on your desktop), then it can be shown by opening the terminal and then entering the following command:


mhwd-kernel -li
= GUI Tool = <!--T:4-->
[[File:Msm-kernels.jpg|thumb|left|375px]]


The above command not only shows which kernel is being used on my machine, it also lists any other kernels that are also installed, as shown in the following Terminal output:
<!--T:5-->
[[Manjaro Settings Manager]] offers an easy way to add and remove kernel (including the necessary kernel modules).


  [handy@jarmano ~]$ mhwd-kernel -li
<!--T:6-->
  Currently running: 3.10.1-1-MANJARO (linux310)
New kernels can be installed by pressing the "Install" button.  All necessary kernel modules will be installed automatically with a new kernel as well.  
 
<!--T:7-->
Please consider the "Recommended" tag when choosing a kernel.  LTS means Long Term Support, which is safest for most users. [["What should I be aware of if I'm not on an LTS kernel?"]]
 
<!--T:8-->
The newest installed Kernel will be booted by default, but to run other kernels that are installed, see [[Manjaro_Kernels#Selecting_Kernels|Selecting Kernels]] section below.
 
<!--T:9-->
<br clear="all" />
 
= Terminal Commands = <!--T:10-->
 
<!--T:11-->
Instead of using the [[Manjaro Settings Manager]] GUI to identify, choose, add, and remove kernels everything can be achieved from a terminal as well.
 
 
== Identifying the Kernel Being Used == <!--T:12-->
 
<!--T:13-->
This terminal command will give your system's kernel information:
 
<!--T:14-->
{{UserCmd|command=mhwd-kernel -li}}
 
<!--T:15-->
The above command not only shows which kernel is being used, it also lists any other kernels that are also installed, as shown in the following example Terminal output:
 
<!--T:16-->
{{UserCmdOutput|command=mhwd-kernel -li|result=
<pre>
  Currently running: 5.0.17-1-MANJARO (linux50)
  The following kernels are installed in your system:
  The following kernels are installed in your system:
     * linux310
     * linux419
     * linux38
     * linux420
     * linux39
     * linux50
</pre>
}}


As seen in the above example, Manjaro is running kernel 3.10.1-1-MANJARO. The information given here is not arbitrary; each part of the kernel name identifies something about that kernel:


* The 3 indicates the version
<!--T:17-->
* The 10 indicates the major revision
As seen in the above example, Manjaro is running kernel 5.0.17-1-MANJARO. The information given here is not arbitrary; each part of the kernel name identifies something about that kernel:
* The 1 indicates the minor revision
 
* The 1 indicates bug fixing
<!--T:18-->
* The 5 indicates the version
* The 0 indicates the major revision
* The 17 indicates the minor revision
* The 1 indicates the revision of the Manjaro package
* MANJARO indicates the specific distribution it is used for
* MANJARO indicates the specific distribution it is used for


= Adding New Kernels =
== Adding New Kernels == <!--T:19-->


{{tip| '''mhwd-kernel will automatically update a newly installed kernel with any modules currently used in your existing kernel'''. For example, if you were to update from kernel 3.9 to 3.10, mhwd-kernel would automatically update 3.10 with any and all modules present in 3.9. How about that!}}
<!--T:20-->
{{tip| '''mhwd-kernel will automatically update a newly installed kernel with any modules currently used in your existing kernel'''. For example, if you were to update from kernel 4.14 to 4.19, mhwd-kernel would automatically update 4.19 with any and all modules present in 4.14. How about that!}}


<!--T:21-->
Manjaro not only supports the use of ''multiple'' kernels (selectable from the boot screen), but allows easy access to the '''very latest ''bleeding edge''''' kernels as well. This is undertaken through use of Manjaro's own ''MHWD-kernel'' (Manjaro Hard-Ware Detection) command. The syntax of the command is as follows:
Manjaro not only supports the use of ''multiple'' kernels (selectable from the boot screen), but allows easy access to the '''very latest ''bleeding edge''''' kernels as well. This is undertaken through use of Manjaro's own ''MHWD-kernel'' (Manjaro Hard-Ware Detection) command. The syntax of the command is as follows:


  sudo mhwd-kernel [-i] [new kernel: linux(version)] [optional - remove the current kernel: rmc]
  <!--T:22-->
sudo mhwd-kernel [-i] [new kernel: linux(version)] [optional - remove the current kernel: rmc]




When listing a new kernel to be installed in the command, it is not necessary to write the entire version number. For example, any version of Kernel 3.9 can be listed simply as 'linux39', and any version of Kernel 3.10 can be listed as 'linux310', and so on.  
<!--T:23-->
When listing a new kernel to be installed in the command, it is not necessary 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.  


<!--T:24-->
The optional '''rmc''' ('''<u>r</u>'''e'''<u>m</u>'''ove '''<u>c</u>'''urrent) 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 afterwards'''. This the safer option, and the old kernel can be easily removed when satisfied with the stability and functionality of the new one.  
The optional '''rmc''' ('''<u>r</u>'''e'''<u>m</u>'''ove '''<u>c</u>'''urrent) 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 afterwards'''. This 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 (3.10) '''without deleting the existing kernel currently being used''':
<!--T:25-->
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''':


  sudo mhwd-kernel -i linux310
  <!--T:26-->
{{UserCmd|command=sudo mhwd-kernel -i linux66}}




Otherwise, the following command will install a new kernel (3.10) to replace the existing kernel, '''which will be deleted''':
<!--T:27-->
Otherwise, the following command will install a new kernel (5.10) to replace the existing kernel, '''which will be deleted''':


  sudo mhwd-kernel -i linux310 '''rmc'''
  <!--T:28-->
{{UserCmd|command=sudo mhwd-kernel -i linux510 '''rmc'''}}




<!--T:29-->
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.
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 =
== Removing Kernels == <!--T:30-->


<!--T:31-->
{{warning|DO NOT attempt to delete an existing kernel while it is actually being used by Manjaro at the time. You can first identify what kernel is running on your system by using the command '''mhwd-kernel -li''' in the terminal (see above).}}
{{warning|DO NOT attempt to delete an existing kernel while it is actually being used by Manjaro at the time. You can first identify what kernel is running on your system by using the command '''mhwd-kernel -li''' in the terminal (see above).}}


<!--T:32-->
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:
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:


<!--T:33-->
# The kernel itself
# The kernel itself
# The kernel's headers
# The kernel's headers
# The kernel's extra modules
# The kernel's extra modules


<!--T:34-->
Whether or not the headers and extra modules must be deleted depends on whether or not they have been installed.
Whether or not the headers and extra modules must be deleted depends on whether or not they have been installed.




<!--T:35-->
1. '''To remove a kernel''' use the following syntax:
1. '''To remove a kernel''' use the following syntax:
sudo mhwd-kernel -R linux[version]
sudo mhwd-kernel -r linux[version]




Here is an example for removing kernel 3.9.10-1
<!--T:36-->
Here is an example for removing kernel 5.0.17-1


  sudo mhwd-kernel -R linux39
  <!--T:37-->
{{UserCmd|command=sudo mhwd-kernel -r linux50}}




<!--T:38-->
2. '''To delete a kernel's headers''', the syntax is:
2. '''To delete a kernel's headers''', the syntax is:
sudo pacman -R linux[version]-headers
{{UserCmd|command=sudo pacman -R linux[version]-headers}}




For example, to delete the headers of kernel version 3.9 from the system, the following command would be entered:
<!--T:39-->
  sudo pacman -R linux39-headers
For example, to delete the headers of kernel version 5.0.x from the system, the following command would be entered:
  {{UserCmd|command=sudo pacman -R linux50-headers}}




<!--T:40-->
3. '''To delete a kernel's extra modules''', the syntax is:
3. '''To delete a kernel's extra modules''', the syntax is:
  sudo pacman -R linux[version]-extramodules
  {{UserCmd|command=sudo pacman -R linux[version]-extramodules}}




For example, to delete the extra modules of kernel version 3.9 from the system, the following command would be entered:
<!--T:41-->
  sudo pacman -R linux39-extramodules
For example, to delete the extra modules of kernel version 5.0.x from the system, the following command would be entered:
  {{UserCmd|command=sudo pacman -R linux50-extramodules}}




<!--T:42-->
4. '''To delete all elements of a kernel at the same time'''  - where they are all present on your system - the syntax is:
4. '''To delete all elements of a kernel at the same time'''  - where they are all present on your system - the syntax is:
sudo pacman -R linux[version] linux[version]-headers linux[version]-extramodules
{{UserCmd|command=sudo pacman -R linux[version] linux[version]-headers linux[version]-extramodules}}




For example, to completely remove all elements of kernel version 3.9, the following command would be entered:
<!--T:43-->
  sudo pacman -R linux39 linux39-headers linux39-extramodules
For example, to completely remove all elements of kernel version 5.0.x, the following command would be entered:
  {{UserCmd|command=sudo pacman -R linux50 linux50-headers linux50-extramodules}}


<!--T:44-->
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 worthwhile 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 virtualisation process itself.
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 worthwhile 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 virtualisation process itself.


= Selecting Kernels =
== Don't forget the mhwd-kernel -h command == <!--T:45-->
 
[[file:kernel_select.png|thumb|left|375px]]
 
 
All available kernels installed on your system will be presented upon booting up. As illustrated, this includes backup copies of each kernel version installed (which will also be automatically removed if or when a kernel version is deleted). To select a kernel, simply use the arrow keys to highlight the desired version, and then press <enter>.
 
Where a selection is not made, Manjaro will usually automatically select a kernel version after waiting five seconds for a key entry. The version automatically selected will usually be the one used previously.
<br clear="all" />
 
= Don't forget the mhwd-kernel -h command =


<!--T:46-->
As with most Linux commands that can be entered into the Terminal, typing the command followed by either '''-h''' or '''--help''' will print out the usage & available options to the Terminal for your reference. Here is the output of the '''mhwd-kernel -h''' command:
As with most Linux commands that can be entered into the Terminal, typing the command followed by either '''-h''' or '''--help''' will print out the usage & available options to the Terminal for your reference. Here is the output of the '''mhwd-kernel -h''' command:


  [handy@jarmano ~]$ mhwd-kernel -h
  <!--T:47-->
Usage: mhwd-kernel [option]
{{UserCmdOutput|command=mhwd-kernel -h|result=<pre>
Usage: mhwd-kernel [option]
     -h  --help              Show this help message
     -h  --help              Show this help message
     -i  --install          Install a new kernel        [kernel(s)] [optional: rmc = remove current kernel]
     -i  --install          Install a new kernel        [kernel(s)] [optional: rmc = remove current kernel]
Line 123: Line 180:
     -li --listinstalled    List installed kernels
     -li --listinstalled    List installed kernels
     -r  --remove            Remove a kernel            [kernel(s)]
     -r  --remove            Remove a kernel            [kernel(s)]
<br clear="all"
</pre>}}
 
= Selecting Kernels = <!--T:48-->
 
<!--T:49-->
[[file:kernel_select.png|thumb|left|375px]]
 
<!--T:50-->
All available kernels installed on your system will be presented upon booting up. GNU GRUB is visible with a couple of options. Choose "Advanced Options for Manjaro Linux" by using the arrow keys {{key press|Up}} {{key press|Down}} on your keyboard and then {{key press|Enter}}.
 
<!--T:51-->
On the next screen (as illustrated) are backup copies of each kernel version installed (which will also be automatically removed if or when a kernel version is deleted). To select a kernel, simply use the arrow keys {{key press|Up}} {{key press|Down}} to highlight the desired version, and then press {{key press|Enter}}.
 
<!--T:52-->
{{tip| In case you have hidden your grub menu, you can just press {{key press|Esc}} during boot to show it and make your changes}}
 
<!--T:53-->
<br clear="all"/>
 


[[Category:Contents Page]]
</translate>
[[Category:Contents Page{{#translation:}}]]
[[Category:Kernel{{#translation:}}]]

Latest revision as of 07:57, 23 May 2024

Other languages:
Deutsch • ‎English • ‎Türkçe • ‎français • ‎русский • ‎עברית

Overview

As the name would imply, as with the kernel of a seed, the Linux kernel is the core of a Linux operating system. Every other element of a Linux-based operating system is built around the kernel, which acts as an interface between your computer's hardware and the applications that run on it. As hardware and software applications become more complex and sophisticated, so do the kernels to fully utilise them. As such, Linux kernels are continually under development, with new revisions and versions being regularly released. Further information on the very latest developments in kernel technology can be found at The Linux Kernel Archives.

The first Linux kernel was originally developed by Linus Torvalds, the creator of Linux. It is now an open-source project containing millions of lines of code generated by thousands of programmers. However, Linus Torvalds still has the final authority on their development and release.


GUI Tool

Msm-kernels.jpg

Manjaro Settings Manager offers an easy way to add and remove kernel (including the necessary kernel modules).

New kernels can be installed by pressing the "Install" button. All necessary kernel modules will be installed automatically with a new kernel as well.

Please consider the "Recommended" tag when choosing a kernel. LTS means Long Term Support, which is safest for most users. "What should I be aware of if I'm not on an LTS kernel?"

The newest installed Kernel will be booted by default, but to run other kernels that are installed, see Selecting Kernels section below.


Terminal Commands

Instead of using the Manjaro Settings Manager GUI to identify, choose, add, and remove kernels everything can be achieved from a terminal as well.


Identifying the Kernel Being Used

This terminal command will give your system's kernel information:

user $ mhwd-kernel -li COPY TO CLIPBOARD


The above command not only shows which kernel is being used, it also lists any other kernels that are also installed, as shown in the following example Terminal output:


$ mhwd-kernel -li

 Currently running: 5.0.17-1-MANJARO (linux50)
 The following kernels are installed in your system:
    * linux419
    * linux420
    * linux50


As seen in the above example, Manjaro is running kernel 5.0.17-1-MANJARO. The information given here is not arbitrary; each part of the kernel name identifies something about that kernel:

  • The 5 indicates the version
  • The 0 indicates the major revision
  • The 17 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

Tip
mhwd-kernel will automatically update a newly installed kernel with any modules currently used in your existing kernel. For example, if you were to update from kernel 4.14 to 4.19, mhwd-kernel would automatically update 4.19 with any and all modules present in 4.14. How about that!

Manjaro not only supports the use of multiple kernels (selectable from the boot screen), but allows easy access to the very latest bleeding edge kernels as well. This is undertaken through use of Manjaro's own MHWD-kernel (Manjaro Hard-Ware Detection) command. The syntax of the command is as follows:

sudo mhwd-kernel [-i] [new kernel: linux(version)] [optional - remove the current kernel: rmc]


When listing a new kernel to be installed in the command, it is not necessary 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 afterwards. This 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:

user $ sudo mhwd-kernel -i linux66 COPY TO CLIPBOARD



Otherwise, the following command will install a new kernel (5.10) to replace the existing kernel, which will be deleted:

user $ sudo mhwd-kernel -i linux510 rmc COPY TO CLIPBOARD



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

Warning
DO NOT attempt to delete an existing kernel while it is actually being used by Manjaro at the time. You can first identify what kernel is running on your system by using the command mhwd-kernel -li in the terminal (see above).

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:

  1. The kernel itself
  2. The kernel's headers
  3. The kernel's extra modules

Whether or not the headers and extra modules must be deleted depends on whether or not they have been installed.


1. To remove a kernel use the following syntax: sudo mhwd-kernel -r linux[version]


Here is an example for removing kernel 5.0.17-1

user $ sudo mhwd-kernel -r linux50 COPY TO CLIPBOARD



2. To delete a kernel's headers, the syntax is:

user $ sudo pacman -R linux[version]-headers COPY TO CLIPBOARD



For example, to delete the headers of kernel version 5.0.x from the system, the following command would be entered:

user $ sudo pacman -R linux50-headers COPY TO CLIPBOARD



3. To delete a kernel's extra modules, the syntax is:

user $ sudo pacman -R linux[version]-extramodules COPY TO CLIPBOARD



For example, to delete the extra modules of kernel version 5.0.x from the system, the following command would be entered:

user $ sudo pacman -R linux50-extramodules COPY TO CLIPBOARD



4. To delete all elements of a kernel at the same time - where they are all present on your system - the syntax is:

user $ sudo pacman -R linux[version] linux[version]-headers linux[version]-extramodules COPY TO CLIPBOARD



For example, to completely remove all elements of kernel version 5.0.x, the following command would be entered:

user $ sudo pacman -R linux50 linux50-headers linux50-extramodules COPY TO CLIPBOARD


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 worthwhile 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 virtualisation process itself.

Don't forget the mhwd-kernel -h command

As with most Linux commands that can be entered into the Terminal, typing the command followed by either -h or --help will print out the usage & available options to the Terminal for your reference. Here is the output of the mhwd-kernel -h command:


$ mhwd-kernel -h

Usage: mhwd-kernel [option]
    -h  --help              Show this help message
    -i  --install           Install a new kernel        [kernel(s)] [optional: rmc = remove current kernel]
    -l  --list              List all available kernels
    -li --listinstalled     List installed kernels
    -r  --remove            Remove a kernel             [kernel(s)]


Selecting Kernels

Kernel select.png

All available kernels installed on your system will be presented upon booting up. GNU GRUB is visible with a couple of options. Choose "Advanced Options for Manjaro Linux" by using the arrow keys on your keyboard and then ↵ Enter.

On the next screen (as illustrated) are backup copies of each kernel version installed (which will also be automatically removed if or when a kernel version is deleted). To select a kernel, simply use the arrow keys to highlight the desired version, and then press ↵ Enter.



Tip
In case you have hidden your grub menu, you can just press Esc during boot to show it and make your changes


Cookies help us deliver our services. By using our services, you agree to our use of cookies.