Saturday, August 14, 2010

Kernel Upgrade in Linux

To Update the kernel
  1. use 'uname -a' to reveal current version
  2. use 'rpm -qa | grep -i kernel' - to reveal installed version
The Proper installation/Upgrade method for kernel 
  1. 'rpm -ivh kernel*rpm'   - To install a separate version
Note: Install the following kernel packages if necessary:
  1. kernel-devel* - if module compilation is necessary
  2. kernel-headers* - if recompilation is necessary
Example:
rpm -ivh kernel-2.6.18-53.el5.i686.rpm
Note: This will update GRUB (/boot/grub/grub.conf)
Note: Will also place the new kernel in the /boot file system
Examine the traces in,
  1. /boot
  2. /boot/grub/grub.conf
Now Remove traces of former kernel using 
'rpm -e [--nodeps]' kernel-2.6.18-8.el5  kernel-headers-2.6.18-8.el5 kernel-devel-2.6.18-8.el5’
To Force remove ignoring dependencies give,
'rpm -e --nodeps kernel-headers-2.6.18-8.el5'
Note: Removal of older kernel-* packages cleans up the /boot  and  /boot/grub/grub.conf (menu.lst)  as well.
Confirm that the three  'kernel-*' packages are installed:
a. rpm -qa | grep kernel
Alternatively we can install new 'kernel-headers' and 'kernel-devel' packages using YUM also:
a. yum -y install kernel-headers 
b. yum -y install kernel-devel