19

I did something silly with a build/modprobe/make while running on my latest installed kernel. Now that kernel will not boot. I am currently running on a previous kernel.

How can I clean this up? I would like to just get back to the "stock" latest kernel that is in the apt repo.

Edit: I should note.... I was trying to install flashcache (https://github.com/facebook/flashcache/)

I tried to do

sudo apt-get install --reinstall linux-image-generic linux-image

That didn't fix it; so I tried the "recovery mode" option and see a kernel panic around the loading of the flashcache module.... I must need to delete something, somewhere...

enter image description here

15

I do not know if you have network access but if you have then do:

sudo apt-get install --reinstall linux-image-generic linux-image
2
  • 1
    That does something... but when I reboot I have the same problem. Black screen. – AaronJAnderson Feb 10 '13 at 0:11
  • 7
    In my case I also had to specify the linux image version, e.g. sudo apt-get install --reinstall linux-image-generic linux-image-3.19.0-26-generic. – George Sep 7 '16 at 14:01
10

Simply boot to a previous kernel version and type the following, just replace ## with the kernel version you are trying to boot into.

sudo update-initramfs -u -k 3.2.0-##-generic-pae 

Just replace ## with the kernel version you are trying to boot into.

Follow that with a hello to Grub, and reboot.

sudo update-grub
sudo reboot now

Now you should no longer see a kernel panic when booting into the new kernel.

2
  • 4
    Or sudo update-initramfs -u -k $(uname -r) :) – c24w Aug 16 '19 at 14:12
  • I can't thank you enough for that update-initramfs command. If anyone else is having this kind of issue with the latest installed kernel, boot into grub, then into recovery mode of the previous kernel, and execute this command by passing the latest kernel version to fix it. Worked like a charm! – mj3c Apr 13 '20 at 16:26
1

I have a problem with VGA drivers, and thouse solution is not fix my problem.

The main solution which help, its to remove manulaly and install from the outset

// remove modules
sudo rm -rf /lib/modules/4.13.0-3*

remove headers
sudo rm -rf /usr/src/linux-headers-4.13.0-3*

// clear boot
sudo rm -rf /boot/initrd.img-4.13.0-3*
sudo rm -rf /boot/vmlinuz-4.13.0-3*
sudo rm -rf /boot/System.map-4.13.0-3*
sudo rm -rf /boot/config-4.13.0-3*

// refresh grub. I reboot after update grub, but maybe is not important
sudo update-grub

//check the lastes version of linux images
sudo apt-cache search linux-image |grep 4.14

# linux-image-4.14.0-1003-azure-edge - Linux kernel image for version 4.14.0 on 64 bit x86 SMP
# linux-image-extra-4.14.0-1003-azure-edge - Linux kernel extra modules for version 4.14.0 on 64 bit x86 SMP
# linux-image-4.14.0-1004-azure-edge - Linux kernel image for version 4.14.0 on 64 bit x86 SMP
# linux-image-extra-4.14.0-1004-azure-edge - Linux kernel extra modules for version 4.14.0 on 64 bit x86 SMP

// install the lastes verion
sudo apt-get install linux-image-4.14.0-1004-azure-edge linux-headers-4.14.0-1004-azure-edge linux-image-extra-4.14.0-1004-azure-edge 

// restart pc
sudo reboot now

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.