1829187 Members
17195 Online
109986 Solutions
New Discussion

Upgrade the linux kernel

 
SOLVED
Go to solution
peterchu
Super Advisor

Upgrade the linux kernel

I hv just install a stand alone RH server , I want to update it to the latest packages ( kernel ) , could suggest what is the way to do that ? could I just download the latest kernel rpm and install it ? or I need to do anything ? thx
11 REPLIES 11
Claudio Cilloni
Honored Contributor

Re: Upgrade the linux kernel

I always found hard to upgrade the kernel in Redhat distributions. I suggest you to install the latest Fedora (3).

renarios
Trusted Contributor

Re: Upgrade the linux kernel

Hi,

I always use yum, but you can also use up2date (that's graphical).
You can also just download an rpm and install it.

Cheerio,

Renarios
Nothing is more successfull as failure
Stuart Browne
Honored Contributor

Re: Upgrade the linux kernel

Given that Fedora is just a new name for the 'free' RH versions, I don't see a difference in the process involved.

Yes, you can just download the latest kernel update from RH for your distribution, and then 'rpm -ivh kernel-x.xx.xx-....rpm' on your server after transferring the file onto it.

Make sure you get the appropraite one for your archetecture, and SMP if your server supports it.
One long-haired git at your service...
peterchu
Super Advisor

Re: Upgrade the linux kernel

thx all replies,

I am wonder how many methods can do that and what is the difference :

in the above suggestion : I find two methods 1. download the related rpm 'rpm -ivh kernel-x.xx.xx-....rpm' ;

2. use up2date ,

what is the differece between them ? which one is better ?
do up2date need connect to internet ? need any registration ?

thx a lot
Gopi Sekar
Honored Contributor
Solution

Re: Upgrade the linux kernel

up2date requires internet connection, it has pretty decent GUI to walk you through update process. Also it requires you to have a RHN subscription.

on the other hand, if you can download all related updated rpms for your distribution, then you can upgrade your system(including kernel) by the following method

goto the directory where all RPMs are stored

run: rpm -Fvh *.rpm

-F option does freshen, as the name implies it checks for the installed RPMs and check whether any new version available on the local directory if so it upgrades that rpm with the new one. Other rpm's are left untouched. This process even takes care of kernel rpms. if you are having RH 8.0 and above then kernel upgrade process using rpm command works without any issues. I have done the above procedure a lot of times, i never faced any issue.

Regards,
Gopi
Never Never Never Giveup
peterchu
Super Advisor

Re: Upgrade the linux kernel

thx for your explaination , could advise if I use up2date method , what is the procedure to do it ? thx
peterchu
Super Advisor

Re: Upgrade the linux kernel

I hv one question , does two method have the same result ?
I guess the up2date will upgrade all to the latest packages , but download rpm method only upgrade the kernel but not packages , am I right ? thx
Gopi Sekar
Honored Contributor

Re: Upgrade the linux kernel


if you are new to linux then i would suggest to go for up2date (u need to have RHN subscription), or if you are a power user and willing to explore some more options in linux then i would suggest to go for downloading of rpms

downloading of rpms is your choice, you can decide which rpm to download. it is equivalent to up2date in which, you will simply select the packages to be upgraded and up2date will download those and update. incase of the other method, you download the required rpms and manually update them with rpm -Fvh *.rpm command

there is no difference between the two except up2date is designed for new users from windows platform

Regards,
Gopi
Never Never Never Giveup
Vipulinux
Respected Contributor

Re: Upgrade the linux kernel

Hi
Downlaod the latest kernel ( rpm )
do
rpm -ivh kernel-new.rpm
( dont use Uvh )
Once done boot your machine from the new kernel. If its ok remove the older kernel.
Using ivh is imp as if you have issues with new kernel you can atleat boot from the older one.

Else if you like you can use yum/up2date etc..

Rgds
Vipul
Bejoy C Alias
Respected Contributor

Re: Upgrade the linux kernel

If u want to update only the kernel, then u can download the kernel source from kernel.org , unzip the file ,
go to the extracted directory eg ./usr/src/linux-2.6.xx
if u are using X , u can run 'make xconfig' in that directory to select what all options or drivers u want to include in ur kernel, then do a 'make dep' to setup all dependencies, then 'make clean' , then 'make bzImage' ( this is the long process ) which will make the mew kernel , then issue 'make modules' ( if u selected any drivers as modules ) , then do a 'make modules_install' ( only for modular kernel ) , then do a 'make install' which will copy the kernel and the required files to the correct directories . After rebooting u will get the option to boot to the new kernel..

this may not be a simple thing if u r new to linux
Be Always Joy ......
Madan Thapa
New Member

Re: Upgrade the linux kernel

Upgrading FC3 kernel 2.6.9-1.667 to 2.6.10 and compiling it


Upgrading FC3 kernel 2.6.9-1.667 to 2.6.10 and compiling it( almost same steps to upgrade to 2.6.11 and above ....note--> also check additional documentation)
#############################################################

1. First of all know what version ur kernel is

[root@Fed3 ~]# rpm -q kernel
kernel-2.6.9-1.667
Here the reply to rpm kernel query is kernel-2.6.9-1.667
So, google kernel-2.6.9-1.667.src.rpm and download it, as FC3 on installation doesnot have the /usr/src/linux-version source directory by default.

You can download FC3 your-kernel-ver-src.rpm from http://download.fedora.redhat.com/pub/fedora/linux/core/updates/3/SRPMS/
Install kernel-.src.rpm (given the default RPM configuration, the files this package contains will be written to /usr/src/redhat/)

2. Next issue the command
[root@Fed3 ~]#rpmbuild -bp --target=noarch /usr/src/redhat/SPECS/kernel-2.6.spec

This will create /usr/src/redhat/BUILD/kernel-2.6.9/ directory with kernel source, which will have a file... kernel-2.6.9-i686.config, required if u want to atleast retain your existing kernel/device... configurations support in the new kernel(2.6.10-x.y)

3. Download the latest stable kernel source(herein 2.6.10 kernel), say linux-2.6.10.tar.bz2.
[root@Fed3 ~]#bzip2 -cd linux-2.6.10.tar.bz2 | tar xvf - -C /usr/src/

Here, /usr/src is the location where we want to put the new kernel source(u can opt alternate locations too)

[root@Fed3 ~]#cd /usr/src/linux-2.6.10/
[root@Fed3 ~]#make mrproper
[root@Fed3 ~]#uname -rm (to check if ur system architecture is i386 or i686...."did u see above the file named kernel-2.6.9-i686.config")

4. Copy kernel-2.6.9-i686.config to /usr/src/linux-2.6.10/.config
[root@Fed3 ~]#cp /usr/src/redhat/BUILD/kernel-2.6.9/linux-2.6.9/configs/kernel-2.6.9-i686.conf
ig /usr/src/linux-2.6.10/.config
[root@Fed3 ~]#make oldconfig (to retain ur previous kernel configuration support), Huh....this take lotsa time.

5. [root@Fed3 ~]#make menuconfig (Add support to new devices,cbq or u32 support, etc, etc)

6. [root@Fed3 ~]#make all

7. [root@Fed3 ~]#make modules_install

8. [root@Fed3 ~]# make install

9. Edit grub.conf (/boot/grub/grub.conf)
[root@Fed3 ~]#vi /boot/grub/grub.conf
####### grub.conf after compilation################

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/hdc2
# initrd /initrd-version.img
#boot=/dev/hdc
default=1
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Fedora Core (2.6.10)
root (hd0,0)
kernel /vmlinuz-2.6.10 ro root=LABEL=/1 rhgb quiet
initrd /initrd-2.6.10.img
title Fedora Core (2.6.9-1.667)
root (hd0,0)
kernel /vmlinuz-2.6.9-1.667 ro root=LABEL=/1 rhgb quiet
initrd /initrd-2.6.9-1.667.img

In the above file...just change the default=1 value to default=0, so that your new,shiny kernel becomes the default boot kernel......Like this->

######### New grub.conf###############

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/hdc2
# initrd /initrd-version.img
#boot=/dev/hdc
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Fedora Core (2.6.10)
root (hd0,0)
kernel /vmlinuz-2.6.10 ro root=LABEL=/1 rhgb quiet
initrd /initrd-2.6.10.img
title Fedora Core (2.6.9-1.667)
root (hd0,0)
kernel /vmlinuz-2.6.9-1.667 ro root=LABEL=/1 rhgb quiet
initrd /initrd-2.6.9-1.667.img

10. Reboot your linux box .... It will ask you to choose which kernel to boot (default 5 secs time)...or maybe u can give a tab, after a few seconds of startup to open and choose the kernel boot menu.

Thats it..... Everybody should use the above steps at his own risk....although the author has successfully compiled and upgraded the 2.6 kernel with the above steps...he cannot guarantee successful implementation.