๐ [HowTo] Rescue your system: error: hook ... Invalid value Path
๐ก Newskategorie: Unix Server
๐ Quelle: forum.manjaro.org
@linux-aarhus wrote:
What causes this?
The issue is 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.
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 are affected.
Reproduce
Due to several issues I decided to provoke such situation then describe the steps to fix it.
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... ....
Rebooting this installation fails after grub with the rather laconic message - something like
You need to load a kernel
Then nothing - just sits there.
Rescue
You need an ISO. Boot this 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 on newer version of 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 HoldPgg. :: 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.
Posts: 1
Participants: 1
...