CentOS 7 comes with Kernel Version 3.10.0-229.el7.x8664. Let’s Upgrade the kernel to Latest version for new updates, Features and make the system performance more better. We have to use Third party community application i.e. ELRepo to update the kernel in RHEL/CentOS 7 as by default Redhat/CentOS don’t allow to update the kernel version. The first CentOS release in May 2004, numbered as CentOS version 2, was forked from RHEL version 2.1AS. Since the release of version 7.0, CentOS officially supports only the x86-64 architecture, while versions older than 7.0-1406 also support IA-32 with Physical Address Extension (PAE).
Aug 05, 2019 In this article, we are discussing how to check the kernel version in both Ubuntu and CentOS Linux. The following command works with all Linux distributions, such as Red Hat, CentOS, Debian, and Ubuntu. It also works on other UNIX-like operating systems such as HPUX, FreeBSD, OpenBSD, Solaris. In VirtuslBox's Makefile for vboxvideo, RHEL 7 kernels were picked up by looking for 'el7.x8664' in the name. The original plus kernel was named '.el7.centos.plus.xxx.x8664'. As a result, this kernel was not recognized as a 'RHEL 7 kernel'. So I built the same kernel using 'xxxx.plus.el7.x8664' as the package name. CentOS. Linux Kernel How to Upgrade the Kernel on CentOS 7. By default, CentOS 7 uses an old version of kernel, which is 3.10.x. But the old kernel doesn’t support some new hardwares that we have today. So it’s necessary to update the old kernel for better hardware support.
The kernel is the core of an operating system. The Linux kernel is the monolithic Unix-like kernel of the Linux computer operating system. It was created by Linux Torvalds, and all Linux distributions including Ubuntu, CentOS and Debian are based on this kernel - the Linux kernel.
In this tutorial, I will show you how to upgrade the CentOS 7 kernel to the latest version. We will use a precompiled kernel from the ELRepo repository. By default CentOS 7 uses the kernel 3.10. In this manual we will install the latest stable kernel version 5.0.11.
What is the ELRepo
ELRepo is a community-based repository for Enterprise Linux and supports for RedHat Enterprise (RHEL) and other distribution based on it (CentOS, Scientific, and Fedora).
ELRepo has the focus on packages related to hardware, including filesystem drivers, graphic drivers, network drivers, sound card drivers, webcam, and others.
What we will do:
Update and Upgrade CentOS 7
Checking the Kernel Version
Add ELRepo Repository
Install New Kernel Version
Configure Grub2
Remove Old Kernel
Step 1 - Update and Upgrade CentOS 7
The first thing we must do before upgrading the kernel is to upgrade all packages to the latest version. Update the repository and all packages to their latest versions with yum command below.
Now install yum plugin to get faster when installing and updating packages.
CentOS 7 System updated and all packages upgraded to latest versions.
Step 2 - Checking the Kernel Version
In this tutorial, we will use CentOS 7.6 with default kernel 3.10. Check your CentOS version with commands below.
You will get the system info as below.
For checking the kernel version, you can also use the uname command.
And you get the result about Linux kernel version and the system architecture.
Step 3 - Add ELRepo Repository
Before installing the new kernel version, we need to add a new repository - the ELRepo repository.
Add ELRepo gpg key to the system.
Now add new ELRepo repository with rpm command.
When it's complete, check all repository enabled on the system, and make sure ELRepo is on the list.
ELRepo repository has been added to CentOS 7 server.
Step 4 - Install New CentOS Kernel Version
In this step, we will install a new latest kernel from ELRepo repository, kernel version 5.0.11 - the Latest stable version on kernel.org.
Install ELRepo kernel version with yum command below.
--enablerepo is an option to enable specific repository on CentOS system. By default, 'elrepo' repository is enabled, but not for the 'elrepo-kernel' repository.
You can check all of the available repositories on the system, enabled and disabled repository with the command below.
List CentOS 7 repositories, enabled and disabled repositories.
Step 5 - Configure Grub2 on CentOS 7
At step 4, we've already installed a new kernel 5.0.11 to the system. Now, I will show you how to configure the default kernel version to load when the system is starting.
Centos Check Kernel Version
Check all available kernel versions in the Grub2 with awk command below.
You see that we have two kernel version - 3.10 and 5.0.11.
Now we want to configure the default kernel that will run when the system is starting. We will use kernel 5.0 as our default, so you can use the command below to set it up.
0 - it's from the awk command on the top. Kernel 5.0.11 = 0, and Kernel 3.10 = 1. When you want to back to the old kernel, you can change the value of the grub2-set-default command to 1.
Next, generate the grub2 config with 'gurb2-mkconfig' command, then reboot the server.
Please login to the server again, and check currently kernel usage.
You get a result kernel version 5.0.11 is being used on your system.
Step 6 - Remove an Old Kernel (Optional)
This is an optional step that is useful to get more free space. In this step, I will show you how to remove an old kernel from your CentOS 7 system. This should be done when you have a more than 3 or 5 kernel versions installed on the server.
For this purpose, we need to install the yum-utils utility from the repository.
Now clean your old kernel with command below.
If you get the result below.
That means you've only 2 or 3 Kernel versions installed. If you have more than 3 versions installed, the command will automatically remove the old kernel from your system.
Centos 7 1804 Kernel Version
CentOS 7 Kernel has been updated to the latest stable using ELRepo Kernel Version.