Mkinitcpio tries to create image for a kernel that's no longer installed

Hi everyone.

I have two kernels installed on my system: 6.1 and 6.4. If I run mkinitcpio -P the two kernels are built just fine, but there’s always an error message that bothers me. mkinitcpio apparently looks for a kernel that is no longer installed on my system (6.0) and obviously it fails to do anything about it:

==> Building image from preset: /etc/mkinitcpio.d/linux60.preset: 'default'
==> Using configuration file: '/etc/mkinitcpio.conf'
  -> -k /boot/vmlinuz-6.0-x86_64 -c /etc/mkinitcpio.conf -g /boot/initramfs-6.0-x86_64.img
==> ERROR: specified kernel image does not exist: '/boot/vmlinuz-6.0-x86_64'
==> Building image from preset: /etc/mkinitcpio.d/linux60.preset: 'fallback'
==> Using configuration file: '/etc/mkinitcpio.conf'
  -> -k /boot/vmlinuz-6.0-x86_64 -c /etc/mkinitcpio.conf -g /boot/initramfs-6.0-x86_64-fallback.img -S autodetect
==> ERROR: specified kernel image does not exist: '/boot/vmlinuz-6.0-x86_64'

Now, this is not particularly troubling since the kernels that are installed work fine, but it’s annoying having this error message all the time, so I was wondering how I can make mkinitcpio ‘forget’ this damn kernel 6.0.

Just to give you some context, this is my /etc/mkinitcpio.d folder

linux414.preset.pacsave  linux513.preset.pacsave  linux517.preset.pacsave  linux59.preset.pacsave     linux64.preset
linux419.preset.pacsave  linux514.preset.pacsave  linux518.preset.pacsave  linux59-rt.preset.pacsave  linux-oled.preset.pacsave
linux510.preset.pacsave  linux515.preset.pacsave  linux519.preset.pacsave  linux60.preset
linux511.preset.pacsave  linux516.preset.pacsave  linux54.preset.pacsave   linux61.preset

linux60 is indeed listed, and contrarily to other uninstalled kernels, it shows up as an installed one (without the .pacsave suffix).

I’ve also checked /etc/mkinitcpio.conf but there’s nothing strange in it and it doesn’t even mention any kernel’s name.

My sense is that just renaming linux60.preset as linux60.preset.pacsave should do the trick, as there’s nothing different in the uninstalled kernels’ configuration files apart from the .pacsave suffix, but I’m happy to hear more advice.

Just delete all of them - which you don’t use.

1 Like

Also check if you have a file /boot/linux60-x86_64.kver, and if so, delete it.

Delete that leftover preset file.

1 Like

Thank you all for the advice. I renamed linux60.preset to linux60.preset.pacsave and the error message has disappeared.

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