I was trying to delete old kernels, but I must have deleted all of the kernels on my Ubuntu 11.04 laptop. Is there any way to fix this via USB boot or mounting hard drive on another system?
Boot into a live CD (or live USB), mount some systems, chroot into it and install the kernel. After a successful installation of the kernel, unmount the filesystems.
- Open Terminal
- Mount the Ubuntu partition:
sudo mount /dev/sdXY /mnt
Mount some special partitions:
sudo mount --bind /dev /mnt/dev
sudo mount --bind /proc /mnt/proc
sudo mount --bind /sys /mnt/sys(optional) When you are connected to a network, use the DNS servers from your Live environment (otherwise host names can possibly not be resolved):
cp /etc/resolv.conf /mnt/etc/resolv.conf
- Chroot into the
/mnt
:sudo chroot /mnt
- Install the Linux kernel:
apt-get install linux-image-generic
(no sudo required as you are root after a chroot) After a successful installation of the kernel, get out the chroot and unmount some filesystems:
exit
sudo umount /mnt/sys
sudo umount /mnt/proc
sudo umount /mnt/dev
sudo umount /mnt- Reboot and remove CD or USB:
sudo reboot
No comments:
Post a Comment