How to update the Linux kernel version in Rhel / Centos 7

This article explains how to update / update the latest Linux kernel version in RHEL / CentOS 7. Before we go into what kernel is. The kernel is nothing more than the basis of any operating system or one can say the core component of an operating system. It interacts with and manages all hardware devices such as motherboard, hard drives, system memory, I / O devices such as keyboard, mouse, etc. As we know it BIOS (Basic Input / Output System), which is responsible for initializing all hardware and loading the kernel into system memory. Kernel is the first program that is started when the system is started by loading it into memory. The operating system is then started and all services started.

How to update the Linux kernel version in Rhel / Centos 7

CentOS 7 is delivered with the kernel version 3.10.0-229.el7.x86_64, Update the kernel to the latest version to receive new updates and features and to improve system performance.

We need to use a third party community application, i.e. H. ELRepo to update the kernel in RHEL / CentOS 7 since Redhat / CentOS does not allow the kernel version to be updated by default. ELRepo is a community that creates updated stable kernels, hardware firmware and drivers (e.g. graphics card, LAN card, sound card etc.) and other packages.

Follow the steps below to update the Linux kernel version

To check the current kernel version, we can use the uname command. As shown in the issue below, we currently have the kernel version operating system installed 3.10.0-229.el7.x86_64,

[[email protected] ~]# uname -r   # To check the Kernel Version
3.10.0-229.el7.x86_64

Step: 1 Install the required packages

To update the Linux kernel version, we need the GPG key RPM. So follow the command below to do the same.

[[email protected] ~]# rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org   # To Import RPM GEG Key

Now install a third-party ELRepo community package that will help us update the kernel to the latest version. Therefore, follow the command below to install the elrepo release package.

Note: By default, RHEL / CentOS 7 does not allow you to update the kernel version.

[[email protected] ~]# yum -y install "http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm"   # Install and Enable ELRepo Package
Loaded plugins: fastestmirror, langpacks
elrepo-release-7.0-2.el7.elrepo.noarch.rpm               | 8.4 kB     00:00     
Examining /var/tmp/yum-root-hT5s6h/elrepo-release-7.0-2.el7.elrepo.noarch.rpm: elrepo-release-7.0-2.el7.elrepo.noarch
Marking /var/tmp/yum-root-hT5s6h/elrepo-release-7.0-2.el7.elrepo.noarch.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package elrepo-release.noarch 0:7.0-2.el7.elrepo will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package  Arch   Version          Repository                               Size
================================================================================
Installing:
 elrepo-release
          noarch 7.0-2.el7.elrepo /elrepo-release-7.0-2.el7.elrepo.noarch 5.2 k

Transaction Summary
================================================================================
Install  1 Package

Total size: 5.2 k
Installed size: 5.2 k
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : elrepo-release-7.0-2.el7.elrepo.noarch                       1/1 
  Verifying  : elrepo-release-7.0-2.el7.elrepo.noarch                       1/1 

Installed:
  elrepo-release.noarch 0:7.0-2.el7.elrepo                                      

Complete!

Step: 2 Install the latest stable Linux kernel version

As we can see in the above issue, we have successfully installed the latest version of the elrepo release package. Now we can install the latest Linux kernel version with the following command.

[[email protected] Desktop]# yum -y --enablerepo=elrepo-kernel install kernel-ml   # Install Latest Stable Linux Kernel Version
Loaded plugins: fastestmirror, langpacks
elrepo-kernel                                            | 2.9 kB     00:00     
elrepo-kernel/primary_db                                   | 1.7 MB   00:06     
Loading mirror speeds from cached hostfile
 * base: centos.excellmedia.net
 * elrepo: ftp.colocall.net
 * elrepo-kernel: ftp.colocall.net
 * extras: centos.excellmedia.net
 * updates: centos.excellmedia.net
Resolving Dependencies
--> Running transaction check
---> Package kernel-ml.x86_64 0:4.10.1-1.el7.elrepo will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package        Arch        Version                    Repository          Size
================================================================================
Installing:
 kernel-ml      x86_64      4.10.1-1.el7.elrepo        elrepo-kernel       40 M

Transaction Summary
================================================================================
Install  1 Package

Total download size: 40 M
Installed size: 183 M
Downloading packages:
kernel-ml-4.10.1-1.el7.elrepo.x86_64.rpm                   |  40 MB   01:14     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
  Installing : kernel-ml-4.10.1-1.el7.elrepo.x86_64                         1/1 
  Verifying  : kernel-ml-4.10.1-1.el7.elrepo.x86_64                         1/1 

Installed:
  kernel-ml.x86_64 0:4.10.1-1.el7.elrepo                                        

Complete!

Latest Linux kernel, i.e. kernel-ml.x86_64 0: 4.10.1-1.el7 Installed successfully, restart the system to check and confirm the Linux kernel version.

[[email protected] ~]# reboot

Step: 3 Confirm the updated kernel version

After restarting the system as usual, the following screen is displayed when the system is started, indicating that our Linux kernel has been updated to the following version: 4.10.1-1.el7.elrepo.x86_64, Simply select the updated kernel, which is highlighted below, and press ENTER.

How to update the Linux kernel version in Rhel / Centos 7

Updated Linux kernel version

After logging in, the operating system opens the terminal and executes the following command to check the latest version of the Linux kernel.

[[email protected] ~]# uname -r   # Check Linux Kernel Version
4.10.1-1.el7.elrepo.x86_64

You can also use the following command to check the kernel version.

[[email protected] ~]# uname -a
Linux localhost.localdomain 4.10.1-1.el7.elrepo.x86_64 #1 SMP Sun Feb 26 19:47:48 EST 2017 x86_64 x86_64 x86_64 GNU/Linux

READ ALSO – How To Install Kernel Headers In Ubuntu

That’s all. This article explained how to update Linux kernel Version in Rhel / Centos 7. I hope you like this article. If you like this article, just share it. If you have any questions about this article, please comment.

Sidebar