How to Install or Upgrade to Latest Kernel Version in CentOS 7

If You Appreciate What We Do Here On TecMint, You Should Consider:

  1. Stay Connected to: Twitter | Facebook | Google Plus
  2. Subscribe to our email updates: Sign Up Now
  3. Get your own self-hosted blog with a Free Domain at ($3.95/month).
  4. Become a Supporter - Make a contribution via PayPal
  5. Support us by purchasing our premium books in PDF format.
  6. Support us by taking our online Linux courses

We are thankful for your never ending support.

Gabriel Cánepa

Gabriel Cánepa is a GNU/Linux sysadmin and web developer from Villa Mercedes, San Luis, Argentina. He works for a worldwide leading consumer product company and takes great pleasure in using FOSS tools to increase productivity in all areas of his daily work.

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

RedHat RHCE and RHCSA Certification Book
Linux Foundation LFCS and LFCE Certification Preparation Guide

You may also like...

20 Responses

  1. satyabrata pani says:

    Hi, I had upgrade from centos 7.2 to centos 7.3, but its got upgraded to centos 7.4.

    Please suggest me how i have to degrade from centos 7.4 to centos 7.3

    Thanks: satya

    • Gabriel A. Cánepa says:

      @satya,
      I am not sure if you’re talking about upgrading the kernel or the OS here. Either way, why would you want to downgrade?

  2. Vinay Dabas says:

    It would be great if you can show us how would you upgrade Kernel Version in RHEL7 (in Production Environment). Would you?

    • Gabriel A. Cánepa says:

      @Vinay,
      If you can get us access to a Production RHEL 7 server, we can certainly give it a try.

      • Vinay Dabas says:

        Ok then production might be issue here but let’s say on RHEL7 in generic.

        • Gabriel A. Cánepa says:

          @Vinay – if by RHEL7 in generic you mean any Enterprise Linux 7-like distribution, you have your answer in this post, as it demonstrates how to upgrade the kernel in CentOS 7. Otherwise, please clarify.

          • Vinay Dabas says:

            You have mentioned, “As opposed to Red Hat, CentOS allows the use of ELRepo, a third-party repository that makes the upgrade to a recent version a kernel.”.

            How can we make up for this in RHEL7 as we won’t be able to use ELRepo according to you?

      • Vinay Dabas says:

        Also, you have mentioned, “As opposed to Red Hat, CentOS allows the use of ELRepo, a third-party repository that makes the upgrade to a recent version a kernel.”.

        How can we make up for this in RHEL7?

  3. Kevin Ski says:

    if /etc/default/grub = “GRUB_DEFAULT=saved” then you have to update the env file by looking at the possible menu items
    awk -F\’ ‘$1==”menuentry ” {print i++ ” : ” $2}’ /etc/grub2.cfg
    then update the default with
    grub2-set-default “option number”
    validate the update
    grub2-editenv list
    and reboot

  4. Gagan Bajaj says:

    Can do the same if I am operating centos 6.8 version?

  5. Ries says:

    Can I only pick the latest kernel or a LTS like 4.4?

  6. Ries says:

    Hi,

    Great tutorial,

    I have one question before updating my kernel, how should I pick kernel 4.4 if I choose to want that one? (4.4 is an LTS if I’m correct)

    Regards.

    • Gabriel A. Cánepa says:

      @Ries – to be honest I wrote this article with updating to the latest kernel available in mind. But in theory, you should be perfectly fine with choosing another one. It goes without saying that you may want to test on a non-production machine first to be sure.

  7. pajafumo says:

    And now, how to update kernel headers, etc.

    I got this error

    Error: kernel-ml-headers conflicts with kernel-headers-3.10.0-514.16.1.el7.x86_64
    

    what to do?

    • Ravi Saive says:

      @Pajafumo

      The installed kernel-ml-headers already provides all the needed modules for building kernel, but if you really need kernel-headers, you can remove he kernel-ml-headers package forcibly with rpm:

      # rpm --nodeps -e kernel-ml-headers
      

      Then you can able to install the kernel-headers package using yum tool:

      # yum install kernel-headers
      

      You will get some error warning, but you can ignore those warnings: those dependencies will be installed again once the kernel-headers package is installed.

  8. Prem says:

    Thank u for posting …This method used for production environment or lab setup

  9. Chris Pesoa says:

    This is not one of the best tutorial explaining what the Kernel is and how to upgrade it.
    **THIS IS THE BEST TUTORIAL**

    Is concise.
    To the point.
    Without the boring start story.
    Commands executed without errors.
    Everything you need to GET YOUR KERNEL UPGRADED!

    Thanks a lot!

    Let’s tweet this!

    • Gabriel A. Cánepa says:

      Chris – thank you for your kind words! We’re glad that you liked this article and were able to follow the steps successfully!

Got something to say? Join the discussion.

Your email address will not be published. Required fields are marked *