1

By default, centos 7 comes with kernel version 3.10.x. After installation of centos 7, I have upgraded kernel to 4.6.x that is latest stable version. My system is remote. First, it is very expensive for me to reboot at each kernel update/upgrade. Is there any solution ? Second, if I reboot, still 3.10.x version is loaded. Where is the problem ?

I used following command for upgrading

    rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
    yum install http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm
    yum --enablerepo=elrepo-kernel install kernel-ml
    reboot
  • Kindly, provide us the procedure you used to upgrade the kernel – lese May 24 '16 at 10:09
  • I have updated my question – Shafiq May 24 '16 at 10:47
  • Is the kernel actually installed? please add the output of rpm -qa kernel – lese May 24 '16 at 12:41
  • This is the output of above command kernel-3.10.0-327.13.1.el7.x86_64 kernel-3.10.0-327.3.1.el7.x86_64 – Shafiq May 25 '16 at 4:50
  • From this output, It seems the Kernel 4.6.x was not installed at all with the procedure you used, but this could be a nice luck reading Otheus answer – lese May 25 '16 at 9:03
4

This seems to be a common problem with the latest update to the kernel module.

The CentOS package maintainer seems to have left out or munged the step that builds initramfs after the new kernel is installed. You're left with an unbootable system.

The steps for fixing this are:

  1. Boot into the previous kernel version (in rescue mode).
  2. Re-run dracut for the newer kernel (this step rebuilds initramfs).
  3. Re-run grub2-mkconfig, or edit grub manually (this step specifies initramfs image that will be use for new kernel).
  4. Reboot.

More detailed instructions are found here and here.

0

You need to edit and rebuild the grub config:

sudo grub2-set-default 0
sudo grub2-mkconfig -o /boot/grub2/grub.cfg
sudo reboot

This will ensure that grub boots from the latest installed kernel.

  • 1
    I don't know why this got a downvote. It actually turned out to be the solution when I had this problem. – Michael Hampton Dec 8 '18 at 17:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.