I'm unable to boot into OS after (what I believe is) a failed update

Hey everyone, a bit of a newbie here. I moved from Windows 10 to Manjaro a couple of months back, so it's my first proper dive into the world of GNU/Linux, and I have had no issues until now. Today when I went to download and install available updates from pamac, the download process just got stuck and nothing happened for several minutes. Pretty sure it was frozen, and after closing pamac I was unable to start it again. And Pacman -Syu'ing didn't work either. I decided to restart my PC, but I was unable to, and got this:
Error: file boot/vmlinuz-5.4-x86_x64 not found and another telling me to load a kernel first.

So then I am left wondering, is it a bootloader problem or did the kernel somehow get removed? I want to know if I can resurrect my installation or I will have to start from fresh?

Thanks in advance :slightly_smiling_face:

It's your kernel that got removed. The way pacman ─ the back-end behind Pamac ─ works for updates is that it first removes the original installed package and then installs the updated package. So it's very likely that you closed Pamac right when it was updating the kernel, which means that it will have removed the kernel binary in /boot first. So you don't have a kernel, and you don't have a matching initramfs either.

I would suggest booting up from the install medium in live mode, and then in a terminal issue the command...

manjaro-chroot -a

This will detect your Manjaro installation and will mount the pertinent filesystems, and chroot into that installation. Then, try resuming the update by issuing the following command...

pacman -Syu

Hopefully this will complete the update process, but don't presume too early that it would be hanging. Some packages really do take a long time to install ─ e.g. icon sets.

Also, as advice for future reference, it is always recommended not to use any graphical package managers for a system update, but to instead update from a tty while completely logged out of the GUI environment, and to then reboot immediately afterwards. That way, no shared libraries are in use that are going to be deleted and replaced, and then you stand the least chance of your update/upgrade process getting corrupted.


Addendum: The update/upgrade process also stores all updated packages locally first before it attempts to install them. These packages will be installed under /var/cache/pacman/pkg, and if you have them all, then you could attempt to install them manually from a chroot environment as described above.

In your case, I would start with the kernel package. In the chroot environment, try...

pacman -U exact-name-of-the-package

... first. It may not work, because we've just gone through a change in the way kernels are installed. So you may have to use...

mhwd-kernel -i linux54

... instead.

Hope any of this helps. :wink:

1 Like

you have to go in chroot

  • boot on USb manjaro ( not your disk )
    open a terminal
manjaro-chroot -a ( select 1 if one line )
pacman -Syy ( check internet is on )
pacman -Syyu ( finish update )
mkinitcpio -P ( rebuilt all kernels img on boot )
exit ( leave chroot always before  )

then reboot

1 Like

Thanks for your response. I'm in a live environment right now and doing chroot was of course successful.
When I went to do pacman - Syu (also -Syy and -Syyu), I got the following:

:: Synchronizing package databases...
error: failed to update core (unable to lock database)
error: failed to update extra (unable to lock database)
error: failed to update community (unable to lock database)
error: failed to update multilib (unable to lock database)
error: failed to synchronize all databases

I've tried to use pacman -U with the packages in var/cache/pacman/pkg with apparently no luck either, where I get:

error: failed to init transaction (unable to lock database)
error: could not lock database: File exists
if you're sure a package manager is not already
running, you can remove /var/lib/pacman/db.lck

And also mhwd-kernel -i linux54 gave me:

Error: You can't reinstall your current kernel. Please use 'pacman -Syu' instead to update.

While chrooted, remove the lock first:
rm /var/lib/pacman/db.lck

3 Likes

Back up and running! Thanks a bunch to everyone. And I've learned from my mistake :slightly_smiling_face:

2 Likes

Good to hear that! Thanks for marking my post as the solution but the credit should go to @Aragorn.

2 Likes

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

Forum kindly sponsored by