Make your own free website on Tripod.com

Upgrading The Linux Kernel

Preambles: the Linux kernel which resides in /boot is the core of the O/S. Note that it is possible to upgrade ONLY the kernel to a new version (in contrast with MS Windows where you have to upgrade the whole O/S). Also a Linux system can be configured with multiple kernel versions and the administrator is at liberty to select which one to use when booting up the system (subject to configuration of course) 

Requirements: Linux kernels require header(s) and source(s) files which are part of the C/C++ programmes that are compiled to get the executable kernel. Only one version of these files (in rpm form) can exist on a system at a given time. So to install ( as opposed to upgrade) a newer version of the kernel, you need to install the header and source RPMs for that (new) kernel. These rpms are available on RedHat servers or mirrors. Your best bet is to grab a new version of kernel from the /upgrades (or so) subdirectory of the RedHat version you are using.

Steps (approx :-)

1. Download the kernel-source, kernel-headers and kernel (or kernel-smp if multi-processor support is desired) versions that you need.

Take note of the current versions of these files that you have on the system: rpm -qa | grep kernel

2. Upgrade the kernel-sources and kernel-headers BUT NOT the kernel-smp itself!!!
rpm -Uvh package-name

3. install the new kernel-smp (we are not upgrading so the old kernel still stays in place)
rpm -ivh kernel-smp-2.4.2.i386.rpm
(This allows us to switch from old kernel to new to old etc)

4. edit /etc/lilo.conf (off the top of my head)
you add a new section for the new kernel (exactly like the section for the existing one)

OLD NEW COMMENTS

boot=/dev/hda
map=/boot/map
install=/boot/boot.b
prompt
timeout=50
message=/boot/message
linear
default=linux

image=/boot/vmlinuz-2.4.2-2
label=linux
read-only
root=/dev/hda7

 

boot=/dev/hda
map=/boot/map
install=/boot/boot.b
prompt
timeout=50
message=/boot/message
linear
default=linux20

image=/boot/vmlinuz-2.4.2-2
label=linux
read-only
root=/dev/hda7

image=/boot/vmlinuz-2.4.20-5
label=linux20
read-only
root=/dev/hda7

NOTE: the default option sets the default kernel image to boot from (see the label option in each kernels configuration section)

Also, I got these lines out of a book, so your config may vary a little. One thing you can be certain of is that the two kernel sections should be very similar (except from the changes in version numbers of course!).

5. Reinstall the boot loader: /sbin/lilo
PLEASE, this step SHOULD NOT GIVE ANY ERROR! DO NOT IGNORE ANY ERROR(S) YOU GET! If lilo installs OK, you should get something like: 

added linux* 
added linux20* 
(etc)

6.Reboot the system. When it comes back up, issue "uname -a" to check the kernel version

7. Good luck! :-)


General Notes:

1. When installing the kernel, you may be asked to upgrade certain rpm packages to newer (specified) versions (e.g., the dev package). Just download these files and upgrade them first: rpm -Uvh package.rpm
You may want to note the version of the existing one before upgrading: rpm -qa | grep package-name

2. The kernel-headers package may not be called that exactly - it seems RedHat has slightly changed its naming convention but you should be able to find it.

(3. RedHat 8: don't take my word for it. Please search on google for "redhat 8 stable" or something. Ask on those groups you belong to if redhat 8 is stable - I might be wrong)

4. If you are comfortable with the new kernel and wish to uninstall the old kernel, then follow these instructions

30/03/2004 

Back to main page | Back to the top | Contact me | Favourite sites