Comments on How to Upgrade the Linux Kernel on CentOS 7

In this tutorial, I will show you how to upgrade CentOS 7 kernel to the latest version, and we will be using the kernel from ELRepo repository. CentOS 7 is using 3.10 as the default kernel version. And in this guide, we will install the latest stable version 5.0.

29 Comment(s)

Add comment

Please register in our forum first to comment.

Comments

By: Andy

How to install headers and devel for Kernel 4.18? How to uninstall 3.10 headers?

By: Andy

Considering this URL to answer my question: https://qiita.com/tkprof/items/2ec4ed58790efba3778d

By: Andrew

Thanks!!!! that's the other part I needed for my install.

 

And thanks Muhammad Arul for the origional writeup!!!

By: asysliasa

With this everything is done :D Thank you

By: scorpio

Thanks for the above instruction, you did a good job telling us how, but for what reason would we want to upgrade?

By: till

A Kernel upgrade might be required when you want to use new hardware that the old kernel does not support or when you need functions that are not available in the old Kernel.

By: chris

Thanks for the above instructions.

 

By: Michael

Thank you! Very useful information and steps. In Step 3, where it has the following, check first in http://www.elrepo.org for more updated release

rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rp

By: Rea

Thank you for the writeup ... I tried but I get the error: [root@files ~]# awk -F\' '$1=="menuentry " {print i++ " : " $2}' /etc/grub2.cfgawk: fatal: cannot open file `/etc/grub2.cfg' for reading (No such file or directory)#

/boot is empty except for the ElRepo files and the two empty folders grub2 and efi

I thought in /boot there should be a config file?

Can you help?

By: Oliver Boyers

Go to the location /etc/grub2.cfg and see what yours is called. Mine was grub2-efi.cfg. Use whatever yours is called. 

By: Pedro Salazar

Thanks my friend, Hello from Venezuela

By: raiden

I am stuck at step 5, my linux doesn't have any boot loader intalled

By: Ralph

Thanks for the instructions. Slight type here though: "Next, generate the grub2 config with 'gurb2-mkconfig' command, and then reboot the server."

By: Hasan

Hi Guys,

Need your help urgently, I tried following the instruction given above and  the server is not booting now. The grub.cfg file is corrputed. 

 

[root@AFIBAMBOO bin]# grub2-mkconfig -o /boot/grub2/grub.cfg

No path or device is specified. Usage: grub2-probe [OPTION...] [OPTION]... [PATH|DEVICE] Try 'grub2-probe --help' or 'grub2-probe --usage' for more information. No path or device is specified. Usage: grub2-probe [OPTION...] [OPTION]... [PATH|DEVICE] Try 'grub2-probe --help' or 'grub2-probe --usage' for more information. No path or device is specified. Usage: grub2-probe [OPTION...] [OPTION]... [PATH|DEVICE] Try 'grub2-probe --help' or 'grub2-probe --usage' for more information.

By: trevor getty

The epel link for the 7.0.2 elrepo is now longer valid. If you try that link, it now contains a redirect which will not be followed by the rpm command. Instead use:

http://elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpm

By: Fernando

Thanks Muhammad Arul for the tutorial. It helps me a lot. And thanks Trevor Getty for your actualization, it was very usefull too. 

By: kevin

hello , do you kwno when I can find the lastest version of Centos Version ??

I try search it in centos documentation

By: Bout-chou

Thanks very much, really helpfull

 

By: Arvind Kumar Madhukar

Hey !

 

What to do if newly installed kernel not letting me log in on the server, what about if newly installed kernel stuck on reboot.

 

Please also share the steps how can I revert back one old kernel.

By: Gary Armstrong

I previously had success with this process but this week it is giving me the same problem as Arvind above. Same base image as previously, even using the same kernel as last time causes me to be unable to ssh after the final reboot.

By: Michael

I just installed kernel from ElRepo. It is LT version. Everything works? but... One thing annoys me - every time kernel 3.10 gets update server tries to boot it. Any chance to tell GRUB to use most recent kernel 4?

By: Alessio

awk: fatal: cannot open file `/etc/grub2.cfg' for reading (No such file or directory)

By: mpak1913

soooooooooooooooooooooooooooooooooooooooooooooooooo tnx

By: Fletch Hasues

Better to not provide the specific version number (minor release) of an Elrepo.  Let the major one point to the most recent so that this documentation stays more relevant:https://www.elrepo.org/elrepo-release-7.el7.elrepo.noarch.rpm for CentOS7 for instance.  (Note it isn't 7.0.3, just leave it at 7).

By: Endi Hariadi

thank you for the tutorial. this is amazingly very helpful.

By: Nolanda

Hallo,

I have a CentOS 7 which running a haproxy version 1.5.18. 

I want to upgrade the linux kernel to the latest stable version (5.8.11). 

Does it have any impact to the haproxy?

By: dongguangming

thank you?i upgrade  from  linux kernel  3.10.0-327.18.2.el7.x86_64 to linux kernel 5.10.14-1.el7.elrepo.x86_64 

By: Anonymus

Hi, If I were to be completely sure that I no longer have to use the old version 3 or 4 kernels, we can remove them all and leave only the lasts 5 releases?

Thanks.

By: walter

# rpm -Uvh https://www.elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpmRetrieving https://www.elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpmerror: Failed dependencies:    glibc = 2.17 is needed by elrepo-release-7.0-3.el7.elrepo.noarch