How to restore a deleted kernel

Asked by Christopher

I have a bad feeling that I deleted the current linux-image on my main Oneiric partition while getting rid of old kernels. I'm running Precise on my test partition and have Oneiric on a desktop.

Presuming I did, how can I restore it? I have access to all the files and such, as well as files on the desktop. I still seem to have my linux-header files, but only seem to have the .deb file for the latest kernel.

The output of update-grub shows 11.10 at the bottom, but on reboot there is only Precise and Windows to choose from.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu software-center Edit question
Assignee:
No assignee Edit question
Solved by:
Christopher
Solved:
Last query:
Last reply:
Revision history for this message
Christopher (soft-kristal) said :
#1

I looked at my root folder and compared it with the files I extracted to an SD card from the .deb file and can see that they are missing.

Since gksu has lost it's power to right-click a protected folder and open it as root, I am at a loss on how to proceed. If I must use the command line, I can copy and paste but need detailed instruction. The broken partition is sda6.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#2

Can you give the output of:

dpkg -l | grep linux-image

Thanks

Revision history for this message
Christopher (soft-kristal) said :
#3

After much trial and error of other methods, this worked:

sudo mount /dev/sda6 /mnt && sudo mount --bind /dev /mnt/dev && sudo mount --bind /proc /mnt/proc && sudo mount --bind /sys /mnt/sys && sudo mount --bind /dev/pts /mnt/dev/pts && sudo cp /etc/resolv.conf /mnt/etc/resolv.conf && sudo chroot /mnt

apt-get install linux-image

sudo umount /mnt/dev/pts /mnt/proc /mnt/sys /mnt/dev /mnt