How To Update Linux Kernel Version In Rhel/Centos 7

In this article, we are going to discuss How to Upgrade/Update the latest Linux Kernel Version in RHEL/CentOS 7. Before that let’s understand what is Kernel. The kernel is nothing but a base of any operating system or we can say core part of an operating system. It interacts with all Hardware devices like Motherboard, Hard-disks, System Memory, I/O devices like Keyboard, Mouse..etc and manage it. As we know that BIOS (Basic Input/Output System) which is responsible for initializing all hardware and load the kernel into system memory and Kernel is the first program that starts at system startup by loading into memory then starts the Operating System and then start all services.

How To Update Linux Kernel Version In Rhel/Centos 7

CentOS 7 comes with Kernel Version 3.10.0-229.el7.x86_64. Let’s Upgrade the kernel to the latest version for new updates, Features and make the system performance better.

We have to use a Third-party community application i.e. ELRepo to update the kernel in RHEL/CentOS 7 as by default Redhat/CentOS doesn’t allow to update the kernel version. ELRepo is a community that creates updated stable kernels, Hardware Firmware’s and drivers ( for eg: Graphic Card, LAN Card, Sound Card..etc.) and other packages.

Follow the below Steps to Update Linux Kernel Version

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

[root@localhost ~]# uname -r   # To check the Kernel Version
3.10.0-229.el7.x86_64

Step: 1 Install Required Packages

To update the Linux Kernel Version we have to RPM GPG Key, So follow the below command to do the same.

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

Now Install ELRepo third-party community package which will help us to update the kernel to the latest version. So refer the below command to install the elrepo-release package.

Note: By-Default RHEL/CentOS 7 don’t allow to update the kernel version.

[root@localhost ~]# 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 Latest Stable Linux Kernel Version

As we can see in the output above we successfully installed the latest version of the elrepo-release package, Now let’s go ahead and install the latest Linux kernel version by using the below command.

[root@localhost 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, now reboot the system to check and confirm the Linux Kernel Version.

[root@localhost ~]# reboot

Step : 3 Confirm the Updated Kernel Version

After rebooting the system, as usual, you will able to see the below screen at system startup which is showing that our Linux kernel has been updated to version: 4.10.1-1.el7.elrepo.x86_64. Just select the updated Kernel which is highlighted below and Press ENTER.

Updated Linux Kernel Version

After login, the Operating System opens the terminal and run the below command to check the latest Linux kernel version.

[root@localhost ~]# uname -r   # Check Linux Kernel Version
4.10.1-1.el7.elrepo.x86_64

Also, you can use the below command to check the kernel version.

[root@localhost ~]# 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

Also Read – How to Install Kernel Headers in Ubuntu

That’s all, In this article, we have explained How To Update Linux Kernel Version In Rhel/Centos 7. I hope you enjoy this article. If you like this article, then just share it. If you have any questions about this article, please comment.

Share this:

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Exit mobile version