How to recover from a deleted kernel

I recently uninstalled a bulk of packages using zypper and the -u switch (delete unneeded dependencies). As a result I deleted my only kernel and of course was unable to boot my openSUSE. So if You’re as careless as me this tutorial might be helpful.

The tutorial is for openSUSE 11.4 32bit but with some modification will work for most versions. The recovery is done using a 11.4 netinstall cd.

  • Boot from the cd and choose rescue system
  • Log in as root (no password required)
  • Mount your root partition in the /mnt directory in my case this was done using the following command :
mount /dev/sda7 /mnt
  • Issue the following commands :
mount --bind /dev /mnt/dev
chroot /mnt
mount /proc
mount /sys
  • Download the proper kernel package, which I’ve done using this command :
  • Install the package :
rpm -i kernel-desktop-
  • This should be part of the package installation but just in case run
  • Reboot

This is what has worked for me and I could boot my openSUSE once more.

Best regards,