1. Home
  2. Tutorials
  3. RPM Kernel Installation
Yolinux.com Tutorial

How To Install and Update A Redhat Linux Kernel RPM

This tutorial covers downloading and installing a new kernel for the Redhat distribution of Linux. The Kernel is loaded from the "RPM" package format. This tutorial is most useful for Red Hat 7.1 installations and older which used the Lilo operating system boot loader. Red Hat 7.2 introduced GRUB as the default boot loader and it is configured automatically by the RPM installation. Thus users of Red Hat 7.2-9.0 and Fedora using the GRUB boot loader need not concern themselves with any special configuration requirements. Just install the RPM's and that is it. Use the RPM command "rpm -ivh kernel-2xxx.rpm" and NOT "rpm -Uvh kernel-2xxx.rpm" as is common for most RPM upgrades. The "rpm -Uvh" RPM upgrade command will remove the kernel which is still executing! Use the command "rpm -e kernel-2-OLD.rpm" to remove the old kernel after a system reboot. Also remove reference to the old kernel in the GRUB config file /etc/grub.conf. Typically the removal of the kernel RPM will remove it's entry in /etc/grub.conf.

If installing from kernel source see: YoLinux Tutorial: Compiling the Kernel

If installing on a system with an NVidia graphics card see YoLinux.com: Red Hat installation - Installing the NVidia graphics drivers.

Download:

Down load RPMs from Redhat (updates.redhat.com) or Metalab:

  • FTP command line method:
       ftp ftp.ibiblio.org
    Name: anonymous
    Password: your-email-address@your-isp.com cd pub/Linux/distributions/redhat/updates/current/en/os/i386 prompt mget kernel-*2.2.17-14.i386.rpm cd ../i586 - Only perform these steps for Pentium (586) or K6-2/3 architectures ls get kernel-2.2.17-14.i586.rpm
    OR

  • Point the browser at one of the following sites:

    Note: If using Netscape, press and hold the "Shift" key and select the link to the RPM file to download.

Note: There are precompiled kernels for various architectures (i386, i586, i686, ...) Check your current kernel for its precompiled architecture with the command uname -m. The kernels marked "smp" are for multiprocessor systems or hyper-threaded systems such as some of the Intel Xenon or P4 processors. Hyperthreading must also be enabled. This is often selected in the BIOS for systems on which this is available. The "smp" (symmetric multi-processing) kernels allow for all processors to participate in scheduler tasks as well as all threads (two) in hyper-threaded processors. This will result in significant performance gains on a loaded system.

Installation:

Install the kernel. Using the "-F" "freshen" option will remove all previous kernel installs. Do this only if you are daringly confident. The install option is prefered and safer because if an error is made, hopefully you can always re-boot to the previous kernel.

   rpm -ivh --force kernel-2.2.17-14.i586.rpm
OR rpm -Fvh kernel-2.2.17-14.i586.rpm
Note:
  • The "smp" RPM kernel-smp-2.2.17-14.i586.rpm is for multi-processor systems.
  • Linux kernel RPM: kernel (/boot/vmlinux-2.X.XX-X), modules (/lib/modules/2.X.XX-X/...), /boot/System.map-2.X.XX-X, and /boot/module-info-2.X.XX-X

The next two packages complete the kernel base.

   rpm -ivh --force kernel-ibcs-2.2.17-14.i386.rpm    - Intel Binary Compatability Standard: This allows Linux to run Unixware and commercial UNIX Intel binaries
   rpm -ivh --force kernel-pcmcia-cs-2.2.17-14.i386.rpm - Laptop PCMCIA card support
      

The following RPMs are not required but are helpful to developers or those who want to fine tune the kernel by recompiling at a later date.

   rpm -ivh --nodeps kernel-source-2.2.17-14.i386.rpm
rpm -ivh --nodeps kernel-headers-2.2.17-14.i386.rpm
rpm -Fvh kernel-doc-2.2.17-14.i386.rpm
rpm -Fvh kernel-utils-2.2.17-14.i386.rpm - Provides /usr/bin/ksymoops which translates the kernel's OOPS output to readable messages

The following RPM is used to generate a boot disk. It includes a trimmed down version of the Linux kernel. This kernel is used on the installation boot disks only and should not be used for an installed system, as many features in this kernel are turned off because of the size constraints.

   rpm -ivh kernel-BOOT-2.2.17-14.i386.rpm

Configuration:

Note for SCSI systems:

If your system is booting from a SCSI hard drive, execute the following mkinitrd script which creates the file used to let the system load the SCSI module at boot time:
   /sbin/mkinitrd  /boot/initrd-2.2.17-14.img  2.2.17-14      
  • The second argument is the name of the sub-directory of the modules under the directory /lib/modules/. (In this case /lib/modules/2.2.17-14/)
  • The mkinitrd command is not issued for IDE systems and is SCSI specific. (It actually works on IDE systems but it is pointless. The default Red Hat install also has this.) It also requires a line in /etc/modules.conf (or for older systems: /etc/conf.modules) referencing the SCSI adapter. It will be the line containing the term "scsi_hostadapter".

Configuration:

  • GRUB configuration: GRUB is configured by the RPM installation. The configuration file /etc/grub.conf is modified to reference the new kernel installed. If you want to convert your system from Lilo to GRUB execute the following command (as root) before installing the kernel RPMs:
     
    grub-install --root-directory=/boot '(hd0,0)'

    where GRUB device descriptions are as follows: (hard-drive-number,partition). Use the command df to view the layout of your hard drives. Hard drives are numbered beginning with "0" and include SCSI and EIDE drives without distinction. The designation (hd0,0) is equivalent to Linux device designations /dev/sda1 (SCSI) or /dev/hda1 (EIDE).

    See the YoLinux GRUB boot floppy tutorial for sample GRUB configuration file and more information.

  • Lilo configuration: Next edit the /etc/lilo.conf file. The first option is basic. The second example will allow you to reboot to the previous kernel as well as the new kernel.
    boot=/dev/hda                                   - Location of Lilo boot sector
    map=/boot/map                                   - Locations on hard drive where the kernel can be found for boot
    install=/boot/boot.b
    prompt
    timeout=50
    default=linux
    
    image=/boot/vmlinuz-2.2.17-14
            label=linux
            initrd=/boot/initrd-2.2.17-14.img       - This line is SCSI specific. Omit for IDE
            read-only
            root=/dev/hda7
              

    To allow the system to boot the previous kernel just keep the following lines:

    image=/boot/vmlinuz-2.2.14-5.0
    label=oldlinux
    initrd=/boot/initrd-2.2.14-5.0.img - This line is SCSI specific. Omit for IDE read-only root=/dev/hda7
    Note the numbers must refer to the kernel you are using. See the directory /boot for a listing.

  • Update MBR: Now enter the command lilo -v to write the new information to the Master Boot Record (MBR).
    Diagnostic output:
    LILO version 21, Copyright 1992-1998 Werner Almesberger
    
    Reading boot sector from /dev/sda
    Merging with /boot/boot.b
    Boot image: /boot/vmlinuz-2.2.17-14
    Mapping RAM disk /boot/initrd-2.2.17-14.img
    Added linux *
    
    Writing boot sector.
    
              
    A new /boot/map file will also be generated. This file holds the locations on hard drive where the kernel can be found for boot.

  • Reboot: The command shutdown -r now will cause the system to shutdown and reboot.

    At the boot prompt one can enter "?" to list all the available kernels. In our extended lilo example, two options will be given:linux and oldlinux. The name may be typed in or a caraige return will select the default as assigned.

  • A new kernel and kernel map requires a new boot / recovery disk. See the YoLinux tutorial on generating a boot or recovery diskette.

For more information see:

Books:

Amazon book image "Fedora 18 Desktop Handbook"
by Richard Petersen
Surfing Turtle Press, ISBN# 1936280639
(Mar 6, 2013)

Amazon.com
Amazon book image "Fedora 18 Networking and Servers"
by Richard Petersen
Surfing Turtle Press, ISBN# 1936280698
(March 29, 2013)

Amazon.com
Amazon book image "Fedora 14 Desktop Handbook"
by Richard Petersen
Surfing Turtle Press, ISBN# 1936280167
(Nov 30, 2010)

Amazon.com
Amazon book image "Fedora 14 Administration and Security"
by Richard Petersen
Surfing Turtle Press, ISBN# 1936280221
(Jan 6, 2011)

Amazon.com
Amazon book image "Fedora 14 Networking and Servers"
by Richard Petersen
Surfing Turtle Press, ISBN# 1936280191
(Dec 26, 2010)

Amazon.com
Amazon book image "Fedora 10 and Red Hat Enterprise Linux Bible"
by Christopher Negus
Wiley, ISBN# 0470413395

Amazon.com
"Red Hat Fedora 6 and Enterprise Linux Bible"
by Christopher Negus
Sams, ISBN# 047008278X

Amazon.com
"Fedora 7 & Red Hat Enterprise Linux: The Complete Reference"
by Richard Petersen
Sams, ISBN# 0071486429

Amazon.com
"Red Hat Fedora Core 6 Unleashed"
by Paul Hudson, Andrew Hudson
Sams, ISBN# 0672329298

Amazon.com
"Red Hat Linux Fedora 3 Unleashed"
by Bill Ball, Hoyt Duff
Sams, ISBN# 0672327082

Amazon.com
"Red Hat Linux 9 Unleashed"
by Bill Ball, Hoyt Duff
Sams, ISBN# 0672325888

I have the Red Hat 6 version and I have found it to be very helpful. I have found it to be way more complete than the other Linux books. It is the most complete general Linux book in publication. While other books in the "Unleashed" series have dissapointed me, this book is the best out there.

Amazon.com

   
Bookmark and Share

Advertisements