5.8.18-1-MANJARO' is not a valid kernel module directory

ManjaroKDE latest stable

I have removed 5.8 kernel & modules but bootmenu is not updated afterwards …
==> Building image from preset: /etc/mkinitcpio.d/linux58.preset: ‘default’
-> -k /boot/vmlinuz-5.8-x86_64 -c /etc/mkinitcpio.conf -g /boot/initramfs-5.8-x86_64.img
==> ERROR: ‘/lib/modules/5.8.18-1-MANJARO’ is not a valid kernel module directory
==> Building image from preset: /etc/mkinitcpio.d/linux58.preset: ‘fallback’
-> -k /boot/vmlinuz-5.8-x86_64 -c /etc/mkinitcpio.conf -g /boot/initramfs-5.8-x86_64-fallback.img -S autodetect
==> ERROR: ‘/lib/modules/5.8.18-1-MANJARO’ is not a valid kernel module directory
==> Building image from preset: /etc/mkinitcpio.d/linux59.preset: ‘default’
-> -k /boot/vmlinuz-5.9-x86_64 -c /etc/mkinitcpio.conf -g /boot/initramfs-5.9-x86_64.img

should I remove > /etc/mkinitcpio.d/linux58.preset ?
rm /etc/mkinitcpio.d/linux58.preset
sudo mkinitcpio -P
sudo grub-mkconfig -o /boot/grub/grub.cfg

That sounds like a good idea.

I seems you have manually removed the kernel.

The recommended method is to use the package manager - or if you want the associated extras removed too - you use mhwd.

1 Like

hmm, it’s still shown in grub.cfg … but the 5.8 kernel is no longer installed, any idea?

Zusammenfassung

sudo mkinitcpio -P
==> Building image from preset: /etc/mkinitcpio.d/linux59.preset: ‘default’
-> -k /boot/vmlinuz-5.9-x86_64 -c /etc/mkinitcpio.conf -g /boot/initramfs-5.9-x86_64.img
==> Starting build: 5.9.10-1-MANJARO
-> Running build hook: [base]
-> Running build hook: [udev]
-> Running build hook: [autodetect]
-> Running build hook: [modconf]
-> Running build hook: [block]
-> Running build hook: [keyboard]
-> Running build hook: [keymap]
-> Running build hook: [filesystems]
==> Generating module dependencies
==> Creating gzip-compressed initcpio image: /boot/initramfs-5.9-x86_64.img
==> Image generation successful
==> Building image from preset: /etc/mkinitcpio.d/linux59.preset: ‘fallback’
-> -k /boot/vmlinuz-5.9-x86_64 -c /etc/mkinitcpio.conf -g /boot/initramfs-5.9-x86_64-fallback.img -S autodetect
==> Starting build: 5.9.10-1-MANJARO
-> Running build hook: [base]
-> Running build hook: [udev]
-> Running build hook: [modconf]
-> Running build hook: [block]
-> Running build hook: [keyboard]
-> Running build hook: [keymap]
-> Running build hook: [filesystems]
==> Generating module dependencies
==> Creating gzip-compressed initcpio image: /boot/initramfs-5.9-x86_64-fallback.img
==> Image generation successful

sudo grub-mkconfig -o /boot/grub/grub.cfg
Generating grub configuration file …
Found theme: /usr/share/grub/themes/manjaro/theme.txt
Found linux image: /boot/vmlinuz-5.9-x86_64
Found initrd image: /boot/intel-ucode.img /boot/initramfs-5.9-x86_64.img
Found initrd fallback image: /boot/initramfs-5.9-x86_64-fallback.img
Found linux image: /boot/vmlinuz-5.8-x86_64
Found initrd image: /boot/intel-ucode.img /boot/initramfs-5.8-x86_64.img
Found initrd fallback image: /boot/initramfs-5.8-x86_64-fallback.img
Found memtest86+ image: /boot/memtest86+/memtest.bin

This feels like an xyproblem

The best method in any case is to boot the new kernel then remove the old

$ sudo mhwd -r linux58

It is possible to use mhwd to install a new kernel and remove the old then reboot to load the new kernel

$ sudo mhwd -i linux59 rmc

If you have interfered manually in the system then you need to manually fix it - some way or another

$ sudo pacman -Rns linux58
$ sudo rm -f /boot/*5.8*
2 Likes

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