How to upgrade the kernel on CentOS

Linux-LogoIt requires to updated the Linux Kernels for various reasons. Few of them are Security Fixes, Stability Improvements, Updated Drivers, New Kernel Functions and Increased speed. And we should update our kernel to get the new functionality with our OS. In this tutorial I will show you how to update the kernel of a CentOS system.

Verify the current kernel version:

Before downloading the Kernel and updating it we need to install some prerequisite applications for building kernel:

After installing the prerequisites application now we can download the new kernel source from kernel.org, and install it on our system:


Now we need to generate a kernel configuration.

You can use the same kernel configuration as the currently running kernel. We need to set any newly added configuration options by manually answering questions. To choose default answer just press enter.

After configuration we will now compile the kernel

After completing the compile now we can install it.

Finally we need to edit the /boot/grub/grub.conf to sepcify the new kernel as the default kernel to load. Change the “default” number to the position of your new kernel information.

Share and Enjoy

  • Facebook
  • Twitter
  • Delicious
  • LinkedIn
  • StumbleUpon
  • Add to favorites
  • Email
  • RSS
The following two tabs change content below.

Tapas Mishra

Sr. Engineer (DevOps)
Loves to work on Opensource products. Having experience on Linux environment. Knowledge on Public cloud services like AWS, Rackspace, DigitalOcean, Linode. Please don't hesitate to give a comment on the posts. Your comments are my strength.

One thought on “How to upgrade the kernel on CentOS

  1. On Centos 7, instead of editing /boot/grub/grub.conf to set the default kernel, use this instead: /usr/sbin/grub2-set-default2 [0] Zero for being the first kernel listed, 1, 2, 3 as desired.
    Thank you for writing this, it was useful/helpful

Leave a Reply