Linux Kernel Upgrade

One of the things I'd like to get into this journal is the basics of upgrading the Linux kernel so that it's written down in a good place to find it. Here goes...

  1. Get the RPMs for the kernel. Find out which ones you need by doing an
    rpm -qa | grep kernel and then removing the entries for
    kernelcfg and the like. For me this includes -src, -doc,
    -headers, -pcmcia, -source, -utils
    and for one machine -smp. Just make sure you match what your system has.
  2. If you want make a back-up floppy you can do that as root with:
    # /sbin/mkbootdisk --device /dev/fd0 2.2.14-12
    

    where the version (2.2.14-12) is obtained from /etc/lilo.conf and is pretty self-evident. The important issue is that this is the current version of the kernel.

  3. Upgrade all the kernel RPMs as root with:
    # rpm -Uvh kernel*.rpm
    

    there may very well be errors due to non-empty directories. This is not a problem as those directories that could not be removed can easily be removed manually.

  4. For SCSI-based machines, create new RAM Disk images as root with:
    # /sbin/mkinitrd /boot/initrd-2.2.16-3.img 2.2.16-3
    # /sbin/mkinitrd /boot/initrd-2.2.16-3smp.img 2.2.16-3smp
    

    and remove any old .img files for previous versions of the kernel.

  5. Now edit /etc/lilo.conf and change the references to the old kernel version to the new version. This will most likely be in the image= and initrd= lines. To make these changes effective in the system you need to run lilo as root:
    # /sbin/lilo -v
    
  6. Reboot.

These are pretty terse, but they'll get you through an upgrade.