How to Install or Upgrade to Kernel 5.8 in CentOS 7, CWP7 and VestaCP

by Sandeep B.

In this tutorial we’ll updating/installing Kernel 5.5 on Linux OS – Centos 7. So what is kernel? -A kernel is the lowest level of easily replaceable software that interfaces with the hardware in your computer/server. It is responsible for interfacing all of your applications that are running in “user mode” down to the physical hardware, and allowing processes, known as servers, to get information from each other using inter-process communication (IPC).

In order to Update Kernel This requirements are mandatory :

    • Centos 7 with root access
  • KVM virtualization/any other full virtualization OR Dedicated Server
  • SSH/Terminal access

Let’s started with Kernel install/update procedure :

Check current kernel version :

uname -sr

Eg. output :

[root@server ~]# uname -sr
Linux 3.10.0-123.4.2.el7.x86_64
#version may vary 

Now We’ll Start the procedure of Kernel upgrade on CentOS 7 :

We need to enable the ELRepo repository on CentOS 7, run the below commands :

rpm --import http://www.elrepo.org/RPM-GPG-KEY-elrepo.org
rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpm

You can retrieve latest download links on official page here

Now we’ll install Kernel 4.19 with the below command :

** at the time kernel 4.19 was available as latest version, for latest versions the procedure will be the same.

yum --enablerepo=elrepo-kernel install kernel-ml -y

Now kernel 4.19 will downloaded and installed this process will take some time to complete.

Now we need to add/modify config under /etc/default/grub :

nano /etc/default/grub

And put this line or modify the line if already exists to :

GRUB_DEFAULT=0

eg :

[root@server ~]# cat /etc/default/grub
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="vconsole.keymap=us crashkernel=auto  vconsole.font=latarcyrheb-sun16 rhgb quiet"
GRUB_DISABLE_RECOVERY="true"
GRUB_DEFAULT=0

Save the file and run this command to create the kernel configs :

grub2-mkconfig -o /boot/grub2/grub.cfg

That’s it reboot your server and check the kernel version again :

uname -sr
[root@server ~]# uname -sr
Linux 5.8.5-1.el7.elrepo.x86_64

TO update :

yum clean all
yum --enablerepo=elrepo-kernel install kernel-ml
or
yum --enablerepo=elrepo-kernel update kernel-ml
grub2-mkconfig -o /boot/grub2/grub.cfg
reboot

Clean Old Kernels :

yum install yum-utils -y
package-cleanup --oldkernels --count=1

Advanced cleanup (this will remove old kernel headers and tools):

rpm -qa kernel\* |sort -V
rpm -e --nodeps kernel-tools kernel-tools-libs kernel-headers

Eg. usage :

[root@srv1 ~]# rpm -qa kernel\* |sort -V
kernel-headers-3.10.0-957.10.1.el7.x86_64
kernel-ml-5.0.3-1.el7.elrepo.x86_64
kernel-ml-devel-5.0.3-1.el7.elrepo.x86_64
kernel-tools-3.10.0-957.10.1.el7.x86_64
kernel-tools-libs-3.10.0-957.10.1.el7.x86_64

[root@srv1 ~]# rpm -e --nodeps kernel-tools-3.10.0-957.10.1.el7.x86_64 kernel-tools-libs-3.10.0-957.10.1.el7.x86_64 kernel-headers-3.10.0-957.10.1.el7.x86_64

TO install Latest Kernel-ML devel and tool package:

yum --enablerepo=elrepo-kernel install kernel-ml-devel kernel-ml-tools

If this post helps you in any way please consider a donation

Donate with PayPal :

md-donate

You may also like

4 comments

Stanislav Panayotov April 19, 2018 - 2:24 pm

I report this bug:
http://elrepo.org/bugs/view.php?id=836
Whit kernel-ml 4.16.0-1.el7.elrepo, kernel-ml 4.16.1-1.el7.elrepo and kernel-ml 4.16.2-1.el7.elrepo ssh client is not connecting over IPv6.

Reply
Sandy April 19, 2018 - 11:59 am

nice find (Y)

Reply
Automata December 31, 2019 - 6:14 am

Hi,

Your solution not work for CWP (Centos Web Panel) and CWP PRO (Centos Web Panel Pro) !!!

I made this update whit this guide from Kernel v3.x to Kernel v5.x but at the moment CWP PRO (Centos Web Panel Pro) for Centos 7 has reported it automatically and by itself to the Kernel v3.x !

Please help me to solve this problem.

Thanks in advance for the support.

Reply
Sandy January 1, 2020 - 11:02 am

ensure you’ve stock OS kernel.

Reply

Leave a Comment