How to remove a "ghost-kernel"?

With the last system update kernel 5.8 was automatically removed, but while booting my system the old kernel 5.8 still appears in the advanced boot options:

Kernel 5.8 can not be removed because it is not installed…

$ sudo mhwd-kernel -r linux58
Error: Kernel not installed.
Currently running: 5.4.86-1-MANJARO (linux54)
The following kernels are installed in your system:
* linux510
* linux54

does anyone have an idea how to solve this problem?
thx
bankman

2 Likes

Hi Bankman

Have you tried to update Grub?

sudo update-grub

Hi Graham,
yes, i tried to update Grub with sudo update-grub but that didn’t work…

Have you ever used Grub Customizer? I have read that it can cause ghost entries.

can you report

sudo ls /etc/mkinitcpio.d/*.preset
sudo ls /boot/*

@ Graham: No, i never used Grub Customizer

@ stephane:

$ sudo ls /etc/mkinitcpio.d/*.preset
/etc/mkinitcpio.d/linux510.preset  /etc/mkinitcpio.d/linux58.preset
/etc/mkinitcpio.d/linux54.preset

$ sudo ls /boot/*
/boot/initramfs-5.10-x86_64-fallback.img  /boot/intel-ucode.img
/boot/initramfs-5.10-x86_64.img		  /boot/linux510-x86_64.kver
/boot/initramfs-5.4-x86_64-fallback.img   /boot/linux54-x86_64.kver
/boot/initramfs-5.4-x86_64.img		  /boot/vmlinuz-5.10-x86_64
/boot/initramfs-5.8-x86_64-fallback.img   /boot/vmlinuz-5.4-x86_64
/boot/initramfs-5.8-x86_64.img		  /boot/vmlinuz-5.8-x86_64   

/boot/grub:
fonts  grub.cfg  grubenv  i386-pc  locale  themes

/boot/memtest86+:
memtest.bin

then remove

sudo rm /boot/initramfs-5.8-x86_64-fallback.img 
sudo rm /boot/initramfs-5.8-x86_64.img
sudo rm /boot/vmlinuz-5.8-x86_64 
sudo rm /etc/mkinitcpio.d/linux58.preset
sudo pacman -Qs linux58-
sudo mkinitcpio -P
5 Likes

removed as described but the entry in the advanced boot options is still there

sudo rm /boot/vmlinuz-5.8-x86_64 
sudo update-grub
3 Likes

thank you guys!
The ghost has gone :smiley:

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.