To install a missing kernel, use a LiveCD with Debian or equivalent, mount the partition with the installation to be repaired, and chroot into it as follows: (assuming installation resides on /dev/sda5 and that it is mounted on /mnt/repair)
The previous three commands usually worked in my case as they are but with some non-destructive errors. Nevertheless, accuracy is a virtue, therefore, I am editing my post for better accuracy as highlighted by Head-on-a-Stick.
Code: Select all
# mount /dev/sda5 /mnt/repair
# for i in /sys /proc /dev; do mount --bind $i /mnt/repair$i; done
# cp /etc/resolv.conf /mnt/repair/etc/resolv.conf
# chroot /mnt/repair /bin/bash
# source /etc/profile
# apt-get install kernel-to-install