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
  • Kindly, provide us the procedure you used to upgrade the kernel
    – lese
    May 24, 2016 at 10:09
  • I have updated my question May 24, 2016 at 10:47
  • Is the kernel actually installed? please add the output of rpm -qa kernel
    – lese
    May 24, 2016 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 May 25, 2016 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, 2016 at 9:03

2 Answers 2


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).

    awk -F\' '$1=="menuentry " {print i++ " : " $2}' /etc/grub2.cfg   # <-- version list
    dracut -f initramfs-{specific version here}.x86_64
    dracut -f initramfs-2.6.32-71.el6.x86_64.img 2.6.32-71.el6.x86_64 # <-- example
  3. Re-run grub2-mkconfig, or edit grub manually (this step specifies initramfs image that will be use for new kernel).

    awk -F\' '$1=="menuentry " {print i++ " : " $2}' /etc/grub2.cfg
    grub2-set-default {number} # <-- choose your preferred kernel to startup (0, 1, 2, etc.)
    grub2-set-default 0 # <-- example
    grub2-set-default 1 # <-- example
  4. Reboot.

More detailed instructions are found here and here.


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. Dec 8, 2018 at 17:19
  • this is a helpful answer, in my case, my kernel image was lost for somereason, I need to rebuild the image by : dracut -f initramfs-4.4.247-1.el7.elrepo.x86_64.img first.
    – WUJ
    Dec 6, 2020 at 21:08

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.