[HowTo] Rescue your system: error: hook ... Invalid value Path

What causes this?

The issue is usually provoked when you don't maintain your system at regular intervals - and I am not thinking yearly - because such neglect will often result in similar problems.

As the issue stems from a change in pacman code - you may be affected if you install from an ISO previous to 18.1.5.

More technical it is a change to pacman and libalpm from 5.1 to 5.2. Users keeping their system up-to-date are not affected - users neglecting updates or installing from an older ISO are affected.

Reproduce

Due to several issues I decided to provoke such situation then describe the steps to fix it.

To reproduce the issue I used an Openbox ISO from the archive - 18.0.3 - early 2019 and did a complete install - reboot and a full update

$ sudo pacman -Syu
....
error: hook /usr/share/libalpm/hooks/update-mime-database.hook line 2: invalid value Path
error: hook /usr/share/libalpm/hooks/30-systemd-sysctl.hook line 2: invalid value Path
error: hook /usr/share/libalpm/hooks/30-systemd-tmpfiles.hook line 2: invalid value Path
error: hook /usr/share/libalpm/hooks/20-systemd-sysusers.hook line 2: invalid value Path
error: hook /usr/share/libalpm/hooks/30-systemd-hwdb.hook line 2: invalid value Path
error: hook /usr/share/libalpm/hooks/30-systemd-udev-reload.hook line 2: invalid value Path
error: hook /usr/share/libalpm/hooks/30-systemd-update.hook line 2: invalid value Path
error: hook /usr/share/libalpm/hooks/xorg-mkfontscale.hook line 2: invalid value Path
error: hook /usr/share/libalpm/hooks/30-systemd-catalog.hook line 2: invalid value Path
error: hook /usr/share/libalpm/hooks/30-systemd-binfmt.hook line 2: invalid value Path
error: hook /usr/share/libalpm/hooks/99-grub.hook line 2: invalid value Path
error: hook /usr/share/libalpm/hooks/30-systemd-daemon-reload.hook line 2: invalid value Path
error: hook /usr/share/libalpm/hooks/90-mkinitcpio-install.hook line 2: invalid value Path
error: hook /usr/share/libalpm/hooks/60-mkinitcpio-remove.hook line 2: invalid value Path
:: Running post-transaction hooks...
....

Because the hooks cannot be processed - then upon reboot - your system will lack initramfs, resulting in a message similar to this

error: file '/boot/vmlinuz-5.4.17-x86_64 not found
error: you need to load kernel first

Then nothing - just sits there.

Rescue

You need an ISO. Boot your system using the ISO and chroot into the installation.

# manjaro-chroot -a

If that does not work for you - you need to mount your partitions - a default Manjaro system uses two partitions root and $esp. If you have a customized partition layout you know how to mount it.

Device names can be in the form /dev/sd - /dev/nvme - even /dev/emmc. Use lsblk to identify the device path.

Mount the root on /mnt

# mount /dev/sdy2 /mnt

Then mount the $esp on /mnt/boot/efi

# mount /dev/sdy1 /mnt/boot/efi

Chroot into the system

# manjaro-chroot /mnt /bin/bash

Update pacman

First step is to update pacman - this may succeed or it may not

# pacman -S pacman

Depending on the result continue below

success

Continue with Repair system

failure

Uninstall packages depending pacman e.g. pamac and retry updating pacman.

If this fails - use wget or curl to fetch the current pacman package - unpack the archive to place the files at their designated locations.

Find the current pacman version - use a web browser point to a mirror and locate the package

https://manjaro.moson.eu/stable/core/x86_64/

Or a search using pamac - (replace mirror in below wget with the first mirror in your mirror list).

# pamac search pacman | grep core

Locate the version e.g. 5.2.1-4

Ensure you are in the root / - wget - and unpack the archive.

# cd /
# wget https://manjaro.moson.eu/stable/core/x86_64/pacman-5.2.1-4-x86_64.pkg.tar.zst
# tar -I zstd -xvf pacman-5.2.1-4-x86_64.pkg.tar.zst

Clean up the root

rm -f .BUILDINFO .INSTALL .MTREE .PKGINFO pacman*.pkg.tar.zst

Repair system

symptom

# mkinitcpio -P
==> ERROR: No presets found /etc/mkinitcpio.d

fix

Uninstall mkinitcpio and dependent packages

# pacman -R mkinitcpio

This will result in dependency transaction failure. Add the dependent packages to the command e.g.

# pacman -R mkinitcpio linux419 manjaro-system mkinitcpio-openswap

You will recieve a warning e.g. - press y to continue.

....
warning: manjaro-system is designated as a HoldPkg.
:: HoldPkg was found in target list. Do you want to continue? [y/N]
....

Reinstall the removed packages.

Press then Home then use edit the command and replace -R with -Syu and press Enter

When you installation completes you will have the necessary files initramfs and kernel back in place and you can exit chroot and reboot the system.

14 Likes

A post was split to a new topic: Can't get update to work

I had this issue couple weeks ago when I installed from the available openbox community edition, but only these two errors:

error: hook /usr/share/libalpm/hooks/90-mkinitcpio-install.hook line 2: invalid value Path
error: hook /usr/share/libalpm/hooks/60-mkinitcpio-remove.hook line 2: invalid value Path

As I couldn't find anything about it anywhere, and after 4 installations and re-installations, I looked for those two files online and found versions that seemed newer and had no "path" as value. So I edited the file and tried updating again, it worked, been working so far.

Did I do wrong? Might have been a bit of a kamikaze solution but after so many reinstalls (and considering I had my old Ubuntu install cloned and the /home in another partition) I was kinda just testing whatever >.<

Did you actually read the topic?

Which part of it is hard to understand?

It is explained exactly why it happens and what to do.

I don't have the problem anymore, I managed to fix it, but not in the way you described (it was before you posted this), so I don't know if I did something bad. Hence my reply. The topic is pretty clear, I'm not complaining about it.

I just wondered if my kamikaze fix would be an issue in the long run, as I didn't know what I was doing back then.

Forum kindly sponsored by