Howto: Upgrade Linux Kernel

last updated in Categories , , , , , , , ,

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
$ 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


Posted by: Vivek Gite

The author is the creator of nixCraft and a seasoned sysadmin, DevOps engineer, and a trainer for the Linux operating system/Unix shell scripting. Get the latest tutorials on SysAdmin, Linux/Unix and open source topics via RSS/XML feed or weekly email newsletter.

23 comment

  1. Hi,

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

    Thanks in advance.

  2. 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?

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

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

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

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

  7. @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!

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

  9. 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 ?

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

  11. 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
    Anup Girdhar

  12. 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?


  13. 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’.

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

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

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

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


    Still, have a question? Get help on our forum!