System won't boot, unable to update from chroot

My computer froze during an update and after waiting forever I forced a shutdown, now it won’t boot. I’m unable to update it through chroot because I always get:
“error: failed to commit transaction (invalid or corrupted package (PGP signature))”
when trying to update using pacman.
when trying “pacman-key --refresh-keys”, I get “gpg: error while loading shared libraries: /usr/lib/libsqlite3.so.0: file too short”. For most other things I’ve tried, like “wget https://pkgbuild.com/~eschwartz/repo/x86_64-extracted/pacman-static” to get pacman-static, I also get “error while loading shared libraries … file to short” errors.

1 Like

to fix your update, run those commands when in chroot:
sudo rm -f /var/lib/pacman/sync/*
sudo pacman-mirrors --continent
sudo pacman -Syyu

This is what I get, after the first “Do you want to delete it? [Y/n]”, there come an awful lot more, probably for every package:

[manjaro-gnome /]# sudo pacman -Syyu
:: Synchronizing package databases…
core 169.2 KiB 1244 KiB/s 00:00 [##################################] 100%
extra 1854.1 KiB 3.77 MiB/s 00:00 [##################################] 100%
community 6.9 MiB 8.59 MiB/s 00:01 [##################################] 100%
multilib 182.0 KiB 6.58 MiB/s 00:00 [##################################] 100%
:: Starting full system upgrade…
:: Replace crda with core/wireless-regdb? [Y/n] Y
resolving dependencies…
looking for conflicting packages…
warning: dependency cycle detected:
warning: harfbuzz will be installed before its freetype2 dependency
warning: dependency cycle detected:
warning: lib32-harfbuzz will be installed before its lib32-freetype2 dependency

Packages (231) bluez-libs-5.64-2 chromaprint-1.5.1-3 clutter-1.26.4-2 clutter-gtk-1.8.4-3
cmake-3.23.0-1 cogl-1.22.8-2 colord-gtk-0.3.0-2 colord-gtk-common-0.3.0-2
cpupower-5.17-1 crda-4.14-4 [removal] cronie-1.6.0-2 cups-filters-1.28.14-1
electron-18.0.1-1 electron17-17.3.1-1 eog-41.2-1 evince-41.4-1
extra-cmake-modules-5.92.0-1 file-roller-3.42.0-1 fluidsynth-2.2.6-1 folks-0.15.5-1
foomatic-db-3:20220328-1 freetype2-2.12.0-1 gamemode-1.6.1-2 gc-8.2.0-3 gcr-3.41.0-2
gegl-0.4.36-2 geocode-glib-3.26.2+r9+g6047da3-2 geogebra-6.0.697.0-1
ghostscript-9.56.0-1 gimp-2.10.30-2 gjs-2:1.70.2-1 gnome-autoar-0.4.3-2
gnome-boxes-42.0.1-1 gnome-color-manager-3.36.0+r25+g4aab8b59-1 gnome-desktop-1:41.5-1
gnome-online-accounts-3.44.0-1 gnome-shell-1:41.5-1 gnome-shell-extension-arcmenu-27-1
gnome-shell-extension-desktop-icons-ng-43-1 gnome-shell-extension-gsconnect-49-1
gnome-shell-extension-material-shell-40.a+12+ge67d2fb-3
gnome-shell-extension-unite-61-1 gnome-software-41.5-1 gnome-user-docs-41.5-1
go-2:1.18-1 gobject-introspection-1.72.0-1 gobject-introspection-runtime-1.72.0-1
gparted-1.4.0-1 graphene-1.10.8-1 graphviz-3.0.0-1 groff-1.22.4-7 grub-2.06-5
gsound-1.0.3-2 gst-editing-services-1.20.1-1 gst-plugin-gtk-1.20.1-1
gst-plugin-pipewire-1:0.3.49-1 gst-plugins-bad-1.20.1-1 gst-plugins-bad-libs-1.20.1-1
gst-plugins-base-1.20.1-1 gst-plugins-base-libs-1.20.1-1 gst-plugins-good-1.20.1-1
gst-plugins-ugly-1.20.1-1 gstreamer-1.20.1-1 gtk3-1:3.24.33-2 gtk4-1:4.6.2-1
gtksourceview4-4.8.3-1 gvfs-1.50.0-1 gvfs-afc-1.50.0-1 gvfs-goa-1.50.0-1
gvfs-google-1.50.0-1 gvfs-gphoto2-1.50.0-1 gvfs-mtp-1.50.0-1 gvfs-nfs-1.50.0-1
gvfs-smb-1.50.0-1 harfbuzz-4.2.0-1 harfbuzz-icu-4.2.0-1 highlight-4.2-1
hplip-1:3.22.2-2 hwloc-2.7.1-1 imagemagick-7.1.0.29-1 imath-3.1.5-1 imlib2-1.8.1-1
iproute2-5.17.0-1 jfsutils-1.1.15-8 kauth-5.92.0-1 kcoreaddons-5.92.0-1
kitemmodels-5.92.0-1 kwindowsystem-5.92.0-1 ldb-2:2.5.0-1 lib32-at-spi2-core-2.44.0-1
lib32-atk-2.38.0-1 lib32-cairo-1.17.6-1 lib32-expat-2.4.8-1
lib32-fontconfig-2:2.14.0-1 lib32-freetype2-2.12.0-1 lib32-glib2-2.72.0-1
lib32-glibc-2.35-3 lib32-harfbuzz-4.2.0-1 lib32-krb5-1.19.3-2
lib32-libcanberra-1:0.30+r2+gc0620e4-1 lib32-libgcrypt-1.10.1-1 lib32-libltdl-2.4.7-1
lib32-libsndfile-1.1.0-1 lib32-libxml2-2.9.13-1 lib32-mesa-21.3.8-2 lib32-nss-3.77-1
lib32-nvidia-utils-510.60.02-1 lib32-openssl-1:1.1.1.n-1 lib32-sqlite-3.38.1-1
lib32-util-linux-2.38-1 lib32-vulkan-icd-loader-1.3.208-1 lib32-wayland-1.20.0-2
libadwaita-1:1.1.0-1 libarchive-3.6.0-2 libcanberra-1:0.30+r2+gc0620e4-1
libchamplain-0.12.20-3 libcurl-gnutls-7.82.0-2 libdazzle-3.44.0-1 libevdev-1.12.1-1
libgdata-0.18.1-2 libgee-0.20.5-2 libgnomekbd-1:3.26.1+r5+g54da436-1 libgsf-1.14.49-1
libgweather-40.0+r87+g80e5a652-2 libhandy-1.6.1-1 libinput-1.20.0-2 libjcat-0.1.10-1
libnm-1.36.4-1 libnma-1.8.36-3 libnma-common-1.8.36-3 libopenmpt-0.6.2-1
libosinfo-1.10.0-1 libpeas-1.32.0-1 libphonenumber-1:8.12.39-1 libportal-0.6-1
libportal-gtk3-0.6-1 libsndfile-1.1.0-2 libsynctex-2021.59745-2 libtool-2.4.7-1
libusb-1.0.25-3 libvirt-1:8.2.0-3 libwacom-2.2.0-1 libwpe-1.12.0-2 libxmlb-0.3.8-1
libxnvctrl-510.60.02-1 linux510-5.10.109-1 linux510-nvidia-510.60.02-2 llvm-13.0.1-2
luajit-2.1.0.beta3.r397.g20aea939-1 man-db-2.10.2-1 manjaro-gnome-settings-20220228-4
manjaro-release-21.2.6-1 mc-4.8.28-1 mdadm-4.2-2 meson-0.62.0-1
mhwd-nvidia-510.60.02-1 minizip-1:1.2.12-1 mobile-broadband-provider-info-20220315-1
mutter-x11-scaling-41.5-1 ncdu-2.1.1-1 netctl-1.28-1 networkmanager-1.36.4-1
networkmanager-openconnect-1.2.8-2 networkmanager-openvpn-1.8.18-2
networkmanager-pptp-1.2.10-2 networkmanager-vpnc-1.2.8-2 nm-connection-editor-1.26.0-1
nodejs-17.8.0-1 npm-8.5.5-1 nss-3.77-1 nvidia-utils-510.60.02-1 openconnect-1:8.20-2
openvpn-2.5.6-1 osinfo-db-20220214-1 perl-5.34.1-1 perl-alien-build-2.48-1
perl-html-parser-3.78-1 perl-image-exiftool-12.40-1 perl-libwww-6.59-1
pipewire-1:0.3.49-1 pugixml-1.12.1-1 python-3.10.4-1 python-cairo-1.21.0-1
python-click-8.1.2-1 python-cryptography-36.0.2-1 python-lxml-4.8.0-1
python-markupsafe-2.1.1-1 python-pillow-9.1.0-1 python-pulsectl-22.3.2-1
python-pycurl-7.45.1-1 python-pyopenssl-22.0.0-1 python-pyparsing-3.0.7-1
python-reportlab-3.6.9-1 python-setuptools-1:59.4.0-1 python-tomli-2.0.1-1
python-urllib3-1.26.9-1 qpdf-10.6.3-1 qt5-base-5.15.3+kde+r137-1 qt6-base-6.2.4-1
qt6-svg-6.2.4-1 qt6-translations-6.2.4-1 re2-1:20220401-1 samba-4.16.0-4.0
simple-scan-42.0-1 smbclient-4.16.0-4.0 squashfs-tools-4.5.1-1 suitesparse-5.11.0-1
sushi-41.1-1 systemd-sysvcompat-250.4-2 touche-2.0.5-2 touchegg-2.0.14-1
tracker3-3.3.0-1 tracker3-miners-3.3.0-1 vlc-3.0.17.3-1 vte-common-0.68.0-1
vte3-0.68.0-1 vulkan-headers-1:1.3.208-1 webkit2gtk-2.36.0-2 webkit2gtk-4.1-2.36.0-2
wget-1.21.3-1 wireless-regdb-2022.02.18-3 wpebackend-fdo-1.12.0-2 xorg-docs-1.7.2-1
xorg-iceauth-1.0.9-1 xorg-mkfontscale-1.2.2-1 xorg-setxkbmap-1.3.3-1
xorg-xwayland-22.1.1-1 yelp-tools-42.0-1 yelp-xsl-42.0-1 zenity-3.42.0-1 zip-3.0-10

Total Installed Size: 3702.06 MiB
Net Upgrade Size: 226.11 MiB

:: Proceed with installation? [Y/n] Y
(230/230) checking keys in keyring [##################################] 100%
error: GPGME error: Invalid crypto engine
error: GPGME error: Invalid crypto engine

error: GPGME error: Invalid crypto engine
error: GPGME error: Invalid crypto engine
(230/230) checking package integrity [##################################] 100%
error: GPGME error: Invalid crypto engine
error: GPGME error: Invalid crypto engine

error: GPGME error: Invalid crypto engine
error: GPGME error: Invalid crypto engine
error: harfbuzz: missing required signature
:: File /var/cache/pacman/pkg/harfbuzz-4.2.0-1-x86_64.pkg.tar.zst is corrupted (invalid or corrupted package (PGP signature)).
Do you want to delete it? [Y/n]

press y and check … and use formated text, and also no need to post so many repeating lines

Good thing you showed us 1000 same lines.

This is what I get, could probably press Y a few hundred more times:

error: GPGME error: Invalid crypto engine
error: GPGME error: Invalid crypto engine
error: harfbuzz: missing required signature
:: File /var/cache/pacman/pkg/harfbuzz-4.2.0-1-x86_64.pkg.tar.zst is corrupted (invalid or corrupted package (PGP signature)).
Do you want to delete it? [Y/n] Y
error: freetype2: missing required signature
:: File /var/cache/pacman/pkg/freetype2-2.12.0-1-x86_64.pkg.tar.zst is corrupted (invalid or corrupted package (PGP signature)).
Do you want to delete it? [Y/n] Y
error: libsndfile: missing required signature
:: File /var/cache/pacman/pkg/libsndfile-1.1.0-2-x86_64.pkg.tar.zst is corrupted (invalid or corrupted package (PGP signature)).
Do you want to delete it? [Y/n] Y
error: libusb: missing required signature
:: File /var/cache/pacman/pkg/libusb-1.0.25-3-x86_64.pkg.tar.zst is corrupted (invalid or corrupted package (PGP signature)).
Do you want to delete it? [Y/n] Y
error: tracker3: missing required signature
:: File /var/cache/pacman/pkg/tracker3-3.3.0-1-x86_64.pkg.tar.zst is corrupted (invalid or corrupted package (PGP signature)).
Do you want to delete it? [Y/n] Y
error: gtk3: missing required signature
:: File /var/cache/pacman/pkg/gtk3-1:3.24.33-2-x86_64.pkg.tar.zst is corrupted (invalid or corrupted package (PGP signature)).
Do you want to delete it? [Y/n]

so abort it, and try this:
sudo rm -f /var/lib/pacman/sync/*
sudo pacman -Sc
sudo pacman-mirrors --continent
sudo pacman-mirrors -f5 && pamac update

it gives me this error:

pamac: error while loading shared libraries: /usr/lib/libjson-glib-1.0.so.0: file too short

try this:
sudo pacman -S --overwrite \* libjson-glib

sudo pacman -S --overwrite * libjson-glib
error: target not found: libjson-glib

try
pacman -Sf json-glib

-Sf seems to be an invalid option

it should force it, try the same command without the ‘f’

back to the same good old problem

pacman -S json-glib
warning: json-glib-1.6.6-2 is up to date – reinstalling
resolving dependencies…
looking for conflicting packages…

Packages (1) json-glib-1.6.6-2

Total Installed Size: 0.95 MiB

:: Proceed with installation? [Y/n] Y
:: Retrieving packages…
json-glib-1.6.6-2-x86_64 is up to date
(1/1) checking keys in keyring [##################################] 100%
error: GPGME error: Invalid crypto engine
(1/1) checking package integrity [##################################] 100%
error: GPGME error: Invalid crypto engine
error: json-glib: missing required signature
:: File /var/cache/pacman/pkg/json-glib-1.6.6-2-x86_64.pkg.tar.zst is corrupted (invalid or corrupted package (PGP signature)).
Do you want to delete it? [Y/n]

try this:
rm -f /var/lib/pacman/sync/*
rm -rf /etc/pacman.d/gnupg
pacman -Scc
pacman-key --init
pacman-key --populate manjaro archlinux
pacman-key --refresh
pacman -Syu

pacman -Scc
warning: database file for ‘core’ does not exist (use ‘-Sy’ to download)
warning: database file for ‘extra’ does not exist (use ‘-Sy’ to download)
warning: database file for ‘community’ does not exist (use ‘-Sy’ to download)
warning: database file for ‘multilib’ does not exist (use ‘-Sy’ to download)

Cache directory: /var/cache/pacman/pkg/
:: Do you want to remove ALL files from cache? [y/N] y
removing all files from cache…

Database directory: /var/lib/pacman/
:: Do you want to remove unused repositories? [Y/n] y
removing unused sync repositories…
[manjaro-gnome /]# pacman-key --init
gpg: error while loading shared libraries: /usr/lib/libsqlite3.so.0: file too short
chmod: cannot access ‘/etc/pacman.d/gnupg//trustdb.gpg’: No such file or directory
gpg: error while loading shared libraries: /usr/lib/libsqlite3.so.0: file too short
gpg: error while loading shared libraries: /usr/lib/libsqlite3.so.0: file too short
==> Generating pacman master key. This may take some time.
gpg: error while loading shared libraries: /usr/lib/libsqlite3.so.0: file too short
==> Updating trust database…
gpg: error while loading shared libraries: /usr/lib/libsqlite3.so.0: file too short
==> ERROR: Trust database could not be updated.

run all af those commands, ignore those gpg errors from key init command

[manjaro-gnome /]# pacman-key --populate manjaro archlinux
==> ERROR: You do not have sufficient permissions to read the pacman keyring.
==> Use ‘pacman-key --init’ to correct the keyring permissions.
[manjaro-gnome /]# pacman-key --refresh
==> ERROR: You do not have sufficient permissions to read the pacman keyring.
==> Use ‘pacman-key --init’ to correct the keyring permissions.

damn, and if you try this:
sudo pacman-key --init

same :c