Tuesday, March 13, 2018

How to Install Kernel 4.15 in CentOS 7/RHEL 7

Although some folks use the word Linux to represent the software system as an entire, it's vital to notice that, to be precise, Linux is just the kernel. On the opposite hand, a distribution could be a fully-functional system designed on prime of the kernel with a large style of application tools and libraries.

During traditional operations, the kernel is liable for playacting 2 vital tasks:

Acting as associate degree interface between the hardware and therefore the software package running on the system.
Managing system resources as expeditiously as attainable.
To do this, the kernel communicates with the hardware through the drivers that ar designed into it or people who are often later put in as a module.

For example, once associate degree application running on your machine desires to attach to a wireless network, it submits that request to the kernel, that in turns uses the proper driver to attach to the network.
With new devices and technology setting out sporadically, it's vital to stay our kernel up thus far if we wish to create the foremost of out them. to boot, change our kernel can facilitate North American nation to leverage new kernel functions and to safeguard ourselves from vulnerabilities that are discovered in previous versions.

Ready to update your kernel on CentOS seven or one in every of their derivatives like RHEL seven and Fedora? If thus, keep reading!

Step 1: Checking put in Kernel Version

When we install a distribution it includes an exact version of the Linux kernel. to point out this version put in on our system we will do:

[root@server ~]# uname -sr
 The following image shows the output of the on top of command in a very CentOS seven server:

If we tend to currently head to https://www.kernel.org/, we are going to see that the most recent kernel version is four.15 at the time of this writing (other versions square measure on the market from constant site).

This new Kernel four.15 version could be a semipermanent unleash and can be supported for six years, earlier all UNIX operating system Kernel versions were supported for two years solely.

One necessary factor to think about is that the life cycle of a kernel version – if the version you're presently victimisation is approaching its finish of life, no additional bug fixes are going to be provided subsequently date. For additional data, visit the kernel Releases page.

Step 2: Upgrading Kernel in CentOS seven

Most modern distributions offer the way to upgrade the kernel employing a package management system like yum associate degreed an officially-supported repository.

However, this can solely perform the upgrade to the foremost recent version on the market from the distribution’s repositories – not the most recent one on the market within the https://www.kernel.org/. sadly, Red Hat solely permits to upgrade the kernel victimisation the previous possibility.

As critical Red Hat, CentOS permits the employment of ELRepo, a third-party repository that produces the upgrade to a recent version a kernel.

To alter the ELRepo repository on CentOS seven, do:
Once the repository has been enabled, you'll be able to use the subsequent command to list the on the market kernel.related packages:

[root@server ~]# rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
[root@server ~]# rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpm
Once the repository has been enabled, you'll be able to use the subsequent command to list the on the market kernel.related packages:

[root@server ~]# yum --disablerepo="*" --enablerepo="elrepo-kernel" list available

Next, install the most recent inject stable kernel:

[root@server ~]# yum --enablerepo=elrepo-kernel install kernel-ml

Finally, boot your machine to use the most recent kernel, then run following command to envision the kernel version:

[root@server ~]# uname -sr

Step 3: Set Default Kernel Version in GRUB

To make the newly-installed version the default boot choice, you may have to be compelled to modify the GRUB configuration as follows:

Open and edit the file /etc/default/grub and set GRUB_DEFAULT=0. this suggests that the primary kernel within the GRUB initial screen are going to be used as default.

GRUB_CMDLINE_LINUX="rd.lvm.lv=centos/root rd.lvm.lv=centos/swap crashkernel=auto rhgb quiet"
Next, run the subsequent command to recreate the kernel configuration.

[root@server ~]# grub2-mkconfig -o /boot/grub2/grub.cfg
Reboot and verify that the most recent kernel is currently being employed by default.