Kernel

From PCLinuxOSHelp Knowledge Base
Revision as of 16:07, 16 November 2020 by Terryn (talk | contribs) (typo)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The Kernel is one of the most important components of PCLinuxOS. It is core of the computer's Operating System (OS) with complete control over everything in the system. It is one of the first programs loaded on start-up (after the bootloader) and handles the rest of start-up as well as input/output requests from software for peripherals like disk drives, keyboards, monitors, printers, and speakers. It also handles the allocation of important resources such as memory and CPU time.

Default kernel in PCLinuxOS

You can find out which kernel is running in your system by running the uname command in a terminal window.

    [xxx@localhost ~]$ uname -r
   5.4.11-pclos1

Kernel versions

As development of Linux kernel proceeds, new versions keep on getting released. Newer versions generally mean better hardware support and may be more responsive. The kernel version is made up of three numbers separated by dots e.g. 5.4.11. The first two numbers (5.4) identify the kernel branch and the last number (11) is the release within that branch which is incremented each time a new kernel is released. Branches exist to help separate out new functionality from security and bug fixing. Sometimes new functionality designed for modern machines will not work at all on older machines. These older machines can stay on an older branch but still get security and bug fixes. Certain branches are referred to as LTS (long-term supported) which means they are supported for an extended period of time for older hardware. See kernel.org for currently available branches. The PCLinuxOS repository usually has the latest stable kernel plus the latest updates in one or more of the latest LTS branches.

So when changing kernel you can choose to install the latest kernel in the same (LTS) branch (i.e. same first two numbers in version + highest third number). Or you can install the latest stable kernel (highest second and third number in version)

Reasons to do a kernel update / change

If all of your hardware works with the existing kernel you may not need to switch to the latest branch. However sometimes other major software components (e.g. drivers or Xorg) may require a minimum kernel version in order to work properly. When this happens an announcement is made in the forum instructing users to update their kernel. Other reasons for installing a new kernel include:

  • Important security or bug fixes
  • Better hardware recognition
  • Better performance
  • Miscellaneous - including but not limited to boredom with the existing kernel, adventurous lifestyle, need to fill lots of empty space in the harddrive etc.

Kernel updates

Kernel updates are treated slightly differently by the apt/Synaptic update process. This is because updating implies removal of the previous version which would be dangerous because if the new kernel is not compatible with YOUR hardware you could be left with an unbootable system! Instead, new kernels are added to the system (much like installing a new application). The previous version is kept and will be shown on the boot menu and will remain the default until you select the new kernel to boot. This is achieved using dummy package called kernel-latest which will ensure that new kernels are added to your system as soon as they become available in the repository. If you want to control the addition of kernels yourself then you can remove kernel-latest and you can add new kernels yourself manually when you want to.

To manually add a new kernel to your system:

  • Ensure your system is fully updated
  • Search Synaptic for the keyword kernel-.

SynapticKernelSearch1.png

  • The kernel currently installed will have a solid box next to it.
  • Select the new kernel you wish to add
  • Mark for installation and Apply.
  • Once Synaptic has finished you need to reboot to use the new kernel.
IconNote.png
Note:
The first time you reboot after adding a new kernel it may take longer to boot if you have 3rd party dkms drivers installed (e.g.NVIDIA) because the modules need to be rebuilt to work with the new kernel. You can monitor this process by pressing escape to dismiss the splash screen. Subsequent reboots / startups will be normal.


The original kernel is still installed and is available as a choice in the GRUB menu.

Grub2.png


Development kernels

Sometimes you may encounter a new piece of hardware which is not yet fully supported by the kernels in the stable section of the repository. Or you may be just interested in trying the latest development kernel. PCLinuxOS makes these kernels available in a special section of the repository called kernel which can be activated if you wish to try them. As mentioned above, your old stable kernel is still available so if you have difficulty with the new kernel you can just reboot into that kernel.

The kernel section of the repository is accessible via an option within the Synaptic package manager.

  • Open Synaptic. Go to Settings > Repositories. Click and highlight the line corresponding to your mirror such that the URI box should show the address of your selected mirror.
  • Now look in the Section(s) box. You should see :

x86_64 kde5 xfce4 mate

  • Now click at the end of the above line and add kernel at the end so that your line should now read :

x86_64 kde5 xfce4 mate kernel

The result should look like this : KernelSection.png

  • Click OK and hit Reload.

Now you can search for kernel- to list all the available kernels. Look in the component column, the kernel packages in x86_64 are the stable kernel while the ones in kernel are the development ones. There is also a kernel-latest package in that section which you can install if you would like the latest development kernel added to your system as part of Synaptic Updates when it becomes available.