Failed to open kernel image file

The last few days updating with

sudo pacman -Syu

shows an error:

( 9/14) Updating module dependencies...
(10/14) Running kernel-install...
:: kernel-install installing kernel 6.12.64-1-lts
Failed to open kernel image file '/usr/lib/modules/6.12.64-1-lts/vmlinuz': No such file or directory
:: kernel-install installing kernel 6.12.65-1-lts
(11/14) Checking for old perl modules...

Running pacman -Q $(pacman -Qsq linux kernel | grep ^linux | grep -v headers) shows:
linux 6.18.4.arch1-1
linux-lts 6.12.65-1

System boots, runs without problems.

Any suggestions what would be a smart thing to do in this case?

Operating System: EndeavourOS
KDE Plasma Version: 6.5.4
KDE Frameworks Version: 6.22.0
Qt Version: 6.10.1
Kernel Version: 6.12.64-1-lts (64-bit)
Graphics Platform: Wayland
Processors: 16 Ɨ AMD Ryzen 7 5825U with Radeon Graphics
Memory: 16 GiB of RAM (15.0 GiB usable)
Graphics Processor: AMD Radeon Graphics

If I need to provide more info, please let me know.

It probably means you have some left over data in /usr/lib/modules from kernels that are no longer installed.

It there anything in there that needs to be cleaned up?

This is likely because the kernel directories it is failing to find vmlinuz for are probably not your current kernels so the fact that it is failing is good.

I should, perhaps, be consuming those messages and not letting them show up as errors.

Thanks @dalto I’ll have a look asap. Have been called away just now.

Did cd /usr/lib/modules

This is what I am seeing:

ls -valh

drwxr-xr-x 4 root root 4,0K 12 jan 15:53 .
drwxr-xr-x 181 root root 252K 12 jan 15:53 ..
drwxr-xr-x 4 root root 4,0K 12 jan 15:54 6.12.65-1-lts
drwxr-xr-x 5 root root 4,0K 10 jan 16:01 6.18.4-arch1-1

Only 2 kernels it seems. The kernel in the message does not seem to be present:

Failed to open kernel image file '/usr/lib/modules/6.12.64-1-lts/vmlinuz'

Let me take a look.

Oh, that is a problem with the hook. I am trying add the kernel that was removed.

I have no experience with hooks I’m afraid.

What should I do? Any advice?

I don’t think that this is a direct problem, the hook @dalto is talking about wants to add a removed, and thus old/obsolete kernel, which obviously fails.

Not a problem for normal operating, so do nothing is the answer.

Thanks @fred666 - doing nothing is what I’m good at :wink: .

I’ve done some quick searches for ā€˜hooks’ and what I may have done to mess them up, but have not found any real info yet. Will keep searching some more.

At least, the message is: it’s nothing to worry about.:+1:

Nothing for you to do. I need to fix it. That being said, it is just an annoyance, it won’t cause any problems.

Basically, it fails to do something it shouldn’t be doing in the first place.

Ah, I see - you are one of the people maintaining the hooks we are talking about?

Understood!

Yes, I am the maintainer and I am also the one who caused the error message. :slight_smile:

Thanks.

Now I understand. No further questions. :wink:

Thanks for all the work you do!

I wanna chaim in. I have also seen this ā€œerrorā€ with every kernel update. However, since it never caused any problems, I didn’t pay any further attention to it.
@SemLraug It’s great that you brought up this topic.

@dalto Thanks for the explanation!

No hurry, no worry, but I’d be interested to know what it is, that you have to do to solve the issue, so, - if possible - could you give a heads up here when you’ve been able to do your magic, so that I can mark this issue as solved?

Sure, I will.

i saw the same yesterday, for LTS kernel, after uninstalling it and reinstall i did not see the warning anymore.

I’ve also been getting those errors on kernel updates too lately and assumed it was just an annoyance message, since the update was trying to reinstall a kernel that was no longer present because it was just updated to the latest release, but I’m glad @dalto is on the case to correct the issue :man_mage:

Here is the fix. You will need to wait for kernel-install-for-dracut 1.14.2 to hit the repos.

Thanks!

Will have a look.

:vulcan_salute: