You are not logged in.

#1 2022-05-28 10:22:42

tucuxi
Member
From: Switzerland
Registered: 2020-03-08
Posts: 291

[SOLVED] GPGME error: Invalid crypto engine

While running "pacman -Syu", my laptop ran out of power and now it fails to boot.

I booted the live system, mounted the laptop's partitions, and chrooted into the Arch system.

When I try to complete the failed update, I get many error messages indicating that gpgme is messed up:

[root@archiso ~]# pacman -Syu
...
:: Proceed with installation? [Y/n]
error: GPGME error: Invalid crypto engine

I tried to restore "gpgme" from the package cache using

[root@archiso ~]# pacman -U /var/cache/pacman/pkg/gpgme-1.17.1-1-x86_64.pkg.tar.ztd
loading packages...
error: GPGME error: Invalid crypto engine
error: GPGME error: Invalid crypto engine
error: '/var/cache/pacman/pkg/gpgme-1.17.1-1-x86_64.pkg.tar.zstd': invalid or corrupted package (PGP signature)

An attempt to restore "gnupg" returned the same errors.

With little hope, I tried resetting the keys next:

[root@archiso ~]# pacman-key --init
==> Generating pacman master key. This may take some time.
==> Updating trust database...
[root@archiso ~]# pacman-key --populate archlinux
==> ERROR: There is no secret key available to sign with.
==> Use 'pacman -key --init' to generate a default secret key.

Any other ideas?

Last edited by tucuxi (2022-05-28 18:54:15)

Offline

#2 2022-05-28 11:06:12

Zod
Member
From: Hoosiertucky
Registered: 2019-03-10
Posts: 634

Re: [SOLVED] GPGME error: Invalid crypto engine

Offline

#3 2022-05-28 14:36:02

tucuxi
Member
From: Switzerland
Registered: 2020-03-08
Posts: 291

Re: [SOLVED] GPGME error: Invalid crypto engine

I followed the steps described in the article you linked to up to

pacman --sysroot /mnt -Syu

The result is one error message for each package scheduled for updating:

error: GPGME error: Invalid crypto engine

Next attempt: reinstall all packages using the same method, i.e.

pacman --sysroot /mnt -Qqn | pacman --sysroot /mnt -S -

Same error message, just more of them.

Offline

#4 2022-05-28 18:40:13

loqs
Member
Registered: 2014-03-06
Posts: 18,341

Re: [SOLVED] GPGME error: Invalid crypto engine

With a broken gpg you can not use the --sysroot option:

# pacman --root /mnt --cache /mnt/var/cache/pacman/pkg -Syu

Offline

#5 2022-05-28 19:07:30

tucuxi
Member
From: Switzerland
Registered: 2020-03-08
Posts: 291

Re: [SOLVED] GPGME error: Invalid crypto engine

Thanks, I will keep that in mind for next time. Meanwhile, I  fixed my issues in the following way. Turns out that the broken gnupg package was just one of several dozen.

  1. Delete all files that were installed by the gnupg package. (I got the list from a different Arch machine because pacman -Ql didn't work.)

  2. pacstrap gnupg (Step 1 was necessary because pacstrap cannot overwrite existing files, apparently.)

  3. arch-chroot

  4. Reinstall all broken packages with pacman -S --override. These packages all had zero-sized files in /var/lib/pacman/local.)

Offline

Board footer

Powered by FluxBB