≡ Menu

Howto: Upgrade Linux Kernel

How do I upgrade my Linux kernel? I would like to upgrade kernel without compiling from source code i.e. binary upgrade. How do I perform the actual upgrade of the kernel in Linux?

You need to compile kernel only if:
=> You need custom made kernel for specific task such as embedded kernel.

=> Apply third party security patches.

=> You need to apply specific patch to Linux

Upgrade of the kernel in Red Hat enterprise Linux version <= 4.x

If your system is registered with Red Hat Network (RHN), then you can use the up2date command as follows:
# up2date -f kernel
For SMP kernel (multi core or multiple CPU) use command:
# up2date -f kernel-smp

Upgrade of the kernel in Fedora Linux / CentOS / RHEL 5

Use yum command to upgrade kernel:
# yum update kernel

If you have downloaded RPM file use rpm command:
# rpm -ivh kernel*

Upgrade of the kernel in Debian or Ubuntu Linux

Use apt-get command. First find your kernel version:
$ uname -r
Next find available kernel images:
$ apt-cache search linux-image
Now install kernel by explicitly specifying version number:
# apt-get install linux-image-x.x.x-xx
OR
$ sudo apt-get install linux-image-x.x.x-xx

Upgrade of the kernel in Gentoo Linux

=> Please refer official Gentoo Linux Kernel Upgrade Guide

Tweet itFacebook itGoogle+ itPDF itFound an error/typo on this page?

{ 23 comments… add one }

  • Thilak April 19, 2007, 4:48 pm

    Hi,

    I have upgrade Redhat Enterprise Linux 4 update 4 to update 7 .. Could you please tell me
    procedure to upgrade..

    Thanks in advance.

    • MP July 26, 2011, 4:40 pm

      Hi, i want to update the kernel 32bit to 64 bit locally, how can i do that.
      Any suggestion…?

  • Bernard Hines May 1, 2007, 3:52 pm

    I need to upgrade a server from SLES-7 to SLES-10. I have transferred the users Id’s, groups, directories and files, plus the (passwd, shadow etc). The IP, network names etc. remain the same. Users can sign in and access their files. I have one user who uses “host key authentication” to login, FTP and he is failing. Does he have to rebuild the private and public keys or did I miss a file? What piece of physical server information does “host key authentication” use to tell it that it is on the original server?

  • nixCraft May 1, 2007, 5:13 pm

    Host identification get changed when you make changes to system like reinstall sshd / or server software or change in IP address. Ask your user to rebuild the private and public keys.

  • Hossam Hammady March 10, 2009, 11:37 am

    To get kernel versions available on Ubuntu we do:
    apt-cache search linux-image
    instead of:
    apt-cache search kernel-image
    Thanks

  • Santosh singh rawal May 9, 2009, 1:51 pm

    I am working on Linux Rhel, Fedora .
    Is there any forum, group to provide support for all the queries. Regrding Updation,configuration,Hardware support

  • manoj jasawat July 10, 2009, 11:03 am

    how to configure virtual server at RHEL5.

  • Philippe Petrinko October 22, 2009, 11:45 am

    Hi Vivek,

    Useful topic.

    BTW, I think that current DEBIAN distribution call its kernel image packages “linux-image” and not “kernel-image”.
    Would you check and update your topic ?

    — Philippe

  • nixCraft October 22, 2009, 12:39 pm

    @Philippe / Hossam,

    The faq has been updated. Older version and installer (I think it is still valid in lenny too) used to call it kernel-image. However, they made this change last year or so…

    Appreciate both of your posts!

  • Ahmed May 12, 2010, 8:16 pm

    Well that helped me tho

  • tsog June 18, 2010, 3:59 am

    Thanks for the tip. I had to reinstall a kernel I deleted on Ubuntu, and everywhere I looked on google only offered tips on compiling or removing kernels, not installing from the source.
    Thanks again.

  • Anton July 31, 2010, 11:43 am

    That works fine both in Ubuntu 10.04 and Mint 9. Thanks a lot.

  • Rishabh Dangwal September 2, 2010, 5:51 pm

    Is there any way to replace the exisiting kernel by upgrading it ? Whenever I upgrade my kernel, I get a new entry in boot loader,with entirely new settings. Any ideas ?

  • Stefan Lasiewski September 21, 2010, 11:44 pm

    This guide is missing a step. You’ll need to reboot the machine to load the new Kernel.

    Without this step, your machine is still running the old kernel, and is still vulnerable to any bugs or exploits for that old kernel.

  • anupgirdhar October 5, 2010, 4:34 pm

    Hi
    now I have a problem once i update my kernel? My hardware stop responding on upgration, where my existing kernel is fit and fine but I want to make few changes in the existing one any way to make changes and get the updation in the existing one.
    can I have any doc for the source files on the existing kernel so that i can make the changes and recompile the existing one.
    Waiting for the reply
    Thanks
    Anup Girdhar

  • r00tcrypt March 24, 2011, 10:12 am

    hello i need some guidance here

    i have a RHEL 5.2 (64bit) servers and i want to upgrade the current kernel from kernel-2.6.18-92.el5 to latest release kernel-2.6.18-238.5.1.el5

    Is it possible to upgrade only the kernel without updating all the packages installed in the system or dependencies?

    TIA

  • AVINDO October 1, 2011, 4:05 am

    Hi,

    Where I can get/subscribe Centos/Linux Kernel notification update?

    Thanks b4,

  • Andrei December 10, 2011, 8:31 pm

    Thanks, this is very useful!

  • Karel January 31, 2012, 12:43 pm

    On Ubuntu 10.04 I had to use ‘linux-image-generic-lts-backport-maverick’ rather than ‘linux-image-x.x.x-xx’ because the latter wasn’t found, despite being listed in the search. Yes, I did use the correct numbers in place of the ‘x.x.x-xx’.

  • kram June 17, 2012, 11:40 pm

    thanks for the tutorial, just what i was looking for.

    ps. an adverisement on this webpage forwarded an attack on my computer, my antivirus detected and blocked it however you may want to address this issue. i hope this doesnt scare anyone away as this could happen to any site with advertisements.

    Details:
    Detected By = Norton 360 v6.0
    Description = A Severe Level Intrusion Attempt
    IPS Alert Name = Web Attack: Malicious Toolkit Website 14
    Attacking Computer = burctsnettt.net (91.229.210.195, 80)
    Attacker Url = burctsnettt.net/8zAm0fJCMTstfkpnda7lkCDKKEne7gZ2
    Traffic Description = TCP, www-http

  • sj March 19, 2013, 6:33 am

    Hey guys,

    I wondering do you have the same material on what you are saying here, that is related to MontaVista Linux. Would be great if you can point me to the materials. Thanks.

  • DP April 29, 2013, 2:39 pm

    Excellent thanks for the guide. I updated from Debian 2.6.22.18 Kirkwood to 2.6.32-5 kirkwood.

    Thanks!!

Leave a Comment