Howto: Upgrade Linux Kernel

by Vivek Gite on January 12, 2007 · 19 comments

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

Featured Articles:

Share this with other sys admins!
Facebook it - Tweet it - Print it -

{ 19 comments… read them below or add one }

1 Thilak April 19, 2007

Hi,

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

Thanks in advance.

Reply

2 Bernard Hines May 1, 2007

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?

Reply

3 nixcraft May 1, 2007

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.

Reply

4 Hossam Hammady March 10, 2009

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

Reply

5 Santosh singh rawal May 9, 2009

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

Reply

6 Vivek Gite May 9, 2009
7 manoj jasawat July 10, 2009

how to configure virtual server at RHEL5.

Reply

8 Philippe Petrinko October 22, 2009

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

Reply

9 Vivek Gite October 22, 2009

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

Reply

10 Ahmed May 12, 2010

Well that helped me tho

Reply

11 tsog June 18, 2010

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.

Reply

12 Anton July 31, 2010

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

Reply

13 Rishabh Dangwal September 2, 2010

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 ?

Reply

14 Stefan Lasiewski September 21, 2010

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.

Reply

15 anupgirdhar October 5, 2010

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

Reply

16 r00tcrypt March 24, 2011

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

Reply

17 AVINDO October 1, 2011

Hi,

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

Thanks b4,

Reply

18 Andrei December 10, 2011

Thanks, this is very useful!

Reply

19 Karel January 31, 2012

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

Reply

Leave a Comment

You can use these HTML tags and attributes for your code and commands: <strong> <em> <ol> <li> <u> <ul> <blockquote> <pre> <a href="" title="">
What is 2 + 13 ?
Please leave these two fields as-is:
Solve the simple math so we know that you are a human and not a bot.




Previous post:

Next post: