Kernel updates always cause an error

Hi,

Whenever there’s a system update that involves updating the kernel, I get error messages relating to previous kernel versions, and these versions also appear in GRUB but do not boot.

As far as I can tell, it’s not causing any obvious issues, not any that I can see anyway. But it’s a little annoying getting these errors after an update, and having a cleaner GRUB would be nice too.

I don’t know what other information I can provide to help resolve this, but I’m attaching a screenshot of the error for now.

Thanks

there is no more version 5.7 , 5.8 , 5.9
see this topic , first add linux54 lts & 510lts
then remove older versions

boot on USB iso manjaro

sudo manjaro-chroot -a
pacman -Syyu
mhwd-kernel -r linux57
mhwd-kernel -r linux58
mhwd-kernel -r linux59
mhwd-kernel -i linux54
exit ( end chroot )

then reboot

Thanks, I will do this when I get some time. Did you mean to link to another topic?

Also, after installing 5.4 would I also need to install linux54-nvidia because I’m using an Nvidia card?

I’ve just ran mhwd-kernel -li to see what I already have installed and i get

The following kernels are installed in your system:
   * linux510
   * linux59

So I’m just wondering would removing 5.7 and 5.8 using the above commands even have an effect?

You could try pacman to remove them, first:

sudo pacman -R linux57 linux57-headers linux57-extramodules linux58 linux58-headers linux58-extramodules linux59 linux59-headers linux59-extramodules

If this does not work then you need to remove them completely on file level as you missed the right time to de-install them via mhwd-kernel.

there is this topic fore remove older preset

No, MHWD will do that automatically.

This didn’t work, I get Error: Kernel not installed.

I don’t need to chroot to do this right? Not sure what is meant by removing on a file level, but let’s see how this one goes first.

Cheers

can you returns

sudo mhwd-kernel -li 
sudo ls /etc.mkinitcpio.d/*.preset
mhwd-kernel -li 
The following kernels are installed in your system:
   * linux510
   * linux59

ls /etc/mkinitcpio.d/*.preset
/etc/mkinitcpio.d/linux510.preset  /etc/mkinitcpio.d/linux58.preset
/etc/mkinitcpio.d/linux57.preset   /etc/mkinitcpio.d/linux59.preset

then suppress

sudo rm /etc/mkinitcpio.d/linux57.preset 
sudo rm /etc/mkinitcpio.d/linux58.preset

sudo mhwd-kernel -r linux59
sudo mhwd-kernel -i linux54

sudo mkinitcpio -P
exit ( end-chroot )

then reboot , press Esc go to advanced > select your kernel os version

1 Like

I have followed those steps (except installing 5.4, I will do that later). The 5.9 kernel has been removed and is no longer being listed by mhwd-kernel -li.

But the kernel versions are still being listed in GRUB, and after having done a kernel update now, I am still getting those error messages…

Updating linux initcpios...
==> Building image from preset: /etc/mkinitcpio.d/linux510.preset: 'default'
  -> -k /boot/vmlinuz-5.10-x86_64 -c /etc/mkinitcpio.conf -g /boot/initramfs-5.10-x86_64.img
==> Starting build: 5.10.32-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: [resume]
  -> Running build hook: [filesystems]
==> Generating module dependencies
==> Creating gzip-compressed initcpio image: /boot/initramfs-5.10-x86_64.img
==> Image generation successful
==> Building image from preset: /etc/mkinitcpio.d/linux510.preset: 'fallback'
  -> -k /boot/vmlinuz-5.10-x86_64 -c /etc/mkinitcpio.conf -g /boot/initramfs-5.10-x86_64-fallback.img -S autodetect
==> Starting build: 5.10.32-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: [resume]
  -> Running build hook: [filesystems]
==> Generating module dependencies
==> Creating gzip-compressed initcpio image: /boot/initramfs-5.10-x86_64-fallback.img
==> Image generation successful
==> 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
==> ERROR: '/lib/modules/5.9.16-1-MANJARO' is not a valid kernel module directory
==> 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
==> ERROR: '/lib/modules/5.9.16-1-MANJARO' is not a valid kernel module directory
Error: command failed to execute correctly
Updating Kernel initcpios for Nvidia-DRM...
Updating Grub-Bootmenu
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.10-x86_64
Found initrd image: /boot/intel-ucode.img /boot/initramfs-5.10-x86_64.img
Found initrd fallback image: /boot/initramfs-5.10-x86_64-fallback.img
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 linux image: /boot/vmlinuz-5.7-x86_64
Found initrd image: /boot/intel-ucode.img /boot/initramfs-5.7-x86_64.img
Found initrd fallback image: /boot/initramfs-5.7-x86_64-fallback.img

Then you need to remove

rm /etc/mkinitcpio.d/linux59.preset

I shall do that, however even after removing linux57.preset and linux58.preset as suggested by @stephane you can see the output also refer to those versions as well polluting GRUB

A quick update after having installed 5.4 and removing linux59.preset

mhwd-kernel -li                                                          
Currently running: 5.10.32-1-MANJARO (linux510)
The following kernels are installed in your system:
   * linux510
   * linux54

ls /etc/mkinitcpio.d/*.preset                                            
/etc/mkinitcpio.d/linux510.preset  /etc/mkinitcpio.d/linux54.preset

This is what’s inside /boot

ls -l /boot                                                              
total 226012
drwxr-xr-x 5 root root     4096 Apr 29 20:19 grub
-rw-r--r-- 1 root root 28375406 Apr 29 20:16 initramfs-5.10-x86_64-fallback.img
-rw-r--r-- 1 root root  7330828 Apr 29 20:15 initramfs-5.10-x86_64.img
-rw-r--r-- 1 root root 29024735 Apr 29 20:19 initramfs-5.4-x86_64-fallback.img
-rw-r--r-- 1 root root  7925392 Apr 29 20:19 initramfs-5.4-x86_64.img
-rw-r--r-- 1 root root 31543007 Sep 12  2020 initramfs-5.7-x86_64-fallback.img
-rw-r--r-- 1 root root  9536125 Sep 12  2020 initramfs-5.7-x86_64.img
-rw-r--r-- 1 root root 31254598 Nov 18 14:29 initramfs-5.8-x86_64-fallback.img
-rw-r--r-- 1 root root  9784908 Nov 18 14:29 initramfs-5.8-x86_64.img
-rw-r--r-- 1 root root 29078796 Dec 31 14:15 initramfs-5.9-x86_64-fallback.img
-rw-r--r-- 1 root root  7515130 Dec 31 14:15 initramfs-5.9-x86_64.img
-rw-r--r-- 1 root root  3624960 Feb 17 08:15 intel-ucode.img
-rw-r--r-- 1 root root       22 Apr 21 15:53 linux510-x86_64.kver
-rw-r--r-- 1 root root       22 Apr 21 15:34 linux54-x86_64.kver
drwxr-xr-x 2 root root     4096 Jun  6  2020 memtest86+
-rw-r--r-- 1 root root  8251104 Apr 29 16:46 vmlinuz-5.10-x86_64
-rw-r--r-- 1 root root  6519104 Apr 29 20:19 vmlinuz-5.4-x86_64
-rw-r--r-- 1 root root  6681472 Sep  8  2020 vmlinuz-5.7-x86_64
-rw-r--r-- 1 root root  6804736 Nov  5 19:23 vmlinuz-5.8-x86_64
-rw-r--r-- 1 root root  8141120 Dec 31 14:15 vmlinuz-5.9-x86_64

You can see the references to kernels 5.7, 5.8, and 5.9 although they are no longer installed on my system. Are these what are causing these versions to be listed in GRUB? I’m guessing they need to be removed right?

I would manually remove all the old things not supposed to be here, but there may be a proper way to do that. So do it at your own risk but that seems OK to me. You have a live Manjaro USB anyway just in case?

Yea actually I’d prefer to do it the ‘proper way’ as I’m not quite sure what all of these are.

you have to remove

sudo rm /boot/initramfs-5.7-x86_64-fallback.img
sudo rm /boot/initramfs-5.7-x86_64.img
sudo rm /boot/initramfs-5.8-x86_64-fallback.img
sudo rm /boot/initramfs-5.8-x86_64.img
sudo rm /boot/initramfs-5.9-x86_64-fallback.img
sudo rm /boot/initramfs-5.9-x86_64.img
sudo rm /boot/vmlinuz-5.7-x86_64
sudo rm /boot/vmlinuz-5.8-x86_64
sudo rm /boot/vmlinuz-5.9-x86_64

also check if you keep some old versions modules ( with version 5.7 to 5.9 )

sudo ls /usr/bin/modules/
2 Likes

Ok I have removed those.
/usr/bin/modules/ does not seem to exist.

After a reboot I still see those versions in GRUB, so I ran sudo mkinitcpio -P, but I’m still seeing them

Did you run sudo update-grub as well? :wink:

1 Like