OpenSUSE 11 and SLES 11 Enable Multiple Kernel Support for zypper

By default, when zypper upgrades your kernel, it treats the package like any other package. The old kernel is removed and the new kernel is installed. There are three ways to get your old kernel back (or keep it).

  1. You can re-install it with RPMS. This is involves manually updating your /boot/grub/menu.lst files when you are done.
    In order to boot on your previous kernel
  2. After the upgrade, you can use zypper to install the kernel packages that it removed by throwing various flags on there to force it to ignore conflicts. You still have to go mess with /boot/grub/menu.lst because your old kernel will now be the new default
  3. The best way: Tell zypper to leave your old kernel alone, but install the new kernel as the new default.

Number three is easily done by adding two lines to the /etc/zypp/zypp.conf file before upgrading your kernel.

Add or update these lines in the [main] section of /etc/zypp/zypp.conf

multiversion = provides:multiversion(kernel)
multiversion.kernels = latest,latest-1,running

multiversion defines which packages are allowed to exist with multiple versions of the same package name. Just specifying kernel will allow you to retain all of the available kernel packages. You can restrict which packages by being more specific. For instance: multiversion = kernel-default,kernel-default-base,kernel-source

multiversion.kernels defines package specific retention rules. In this case we defined three to retain:

  1. latest The kernel with the highest version number.
  2. latest-1 The kernel with the next highest version number. This is defined as latest-N where N is the Nth highest version number
  3. running The running kernel version.

If we have three kernels, I would expect to see three after the next update with the oldest of the three falling off the list. If we have two kernels installed, I would expect to see three after the update. If we have one, I would expect two.

The extra, double-cool thing is that the old kernel retain their kdump configurations so you can crash-dump any installed kernel.

This entry was posted in How Tos, linux, OpenSUSE, SLES, zypper. Bookmark the permalink.

Leave a Reply

Your email address will not be published.