Gpg: /usr/lib/libc.so.6: version `GLIBC_2.38' not found (required by gpg)

So I have been trying to fix this myself in order to learn more but I am stuck with anything to do with pacman

I have seen from other discussions here and on other forums different things and have followed many wiki’s and guides but no progress.

Also currently /etc/pacman.conf is set to

SigLevel    = Never

I am currently in a live environment but I have also tried without being in it.

Any help is much appreciated

[manjaro /]# pacman -S vlc
:: Some packages should be upgraded first...
resolving dependencies...
looking for conflicting packages...

Packages (1) archlinux-keyring-20231207-1

Total Download Size:   1.15 MiB
Total Installed Size:  1.64 MiB
Net Upgrade Size:      0.02 MiB

:: Proceed with installation? [Y/n] 
:: Retrieving packages...
 archlinux-keyring-20231207-1-any
 archlinux-keyring-20231207-1-any                                1180.2 KiB  1033 KiB/s 00:01 [#######################################################] 100%
(1/1) checking keys in keyring                                                                [#######################################################] 100%
warning: Public keyring not found; have you run 'pacman-key --init'?
error: GPGME error: Invalid crypto engine
(1/1) checking package integrity                                                              [#######################################################] 100%
warning: Public keyring not found; have you run 'pacman-key --init'?
error: GPGME error: Invalid crypto engine
error: archlinux-keyring: missing required signature
:: File /var/cache/pacman/pkg/archlinux-keyring-20231207-1-any.pkg.tar.zst is corrupted (invalid or corrupted package (PGP signature)).
Do you want to delete it? [Y/n] 
error: failed to commit transaction (invalid or corrupted package (PGP signature))
Errors occurred, no packages were upgraded.

warning: vlc-3.0.20-2 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...

Packages (1) vlc-3.0.20-2

Total Download Size:   11.70 MiB
Total Installed Size:  59.96 MiB
Net Upgrade Size:       0.00 MiB

:: Proceed with installation? [Y/n] 
:: Retrieving packages...
 vlc-3.0.20-2-x86_64                                               11.7 MiB  1525 KiB/s 00:08 [#######################################################] 100%
(1/1) checking keys in keyring                                                                [#######################################################] 100%
warning: Public keyring not found; have you run 'pacman-key --init'?
error: GPGME error: Invalid crypto engine
(1/1) checking package integrity                                                              [#######################################################] 100%
warning: Public keyring not found; have you run 'pacman-key --init'?
error: GPGME error: Invalid crypto engine
error: vlc: missing required signature
:: File /var/cache/pacman/pkg/vlc-3.0.20-2-x86_64.pkg.tar.zst is corrupted (invalid or corrupted package (PGP signature)).
Do you want to delete it? [Y/n] 
error: failed to commit transaction (invalid or corrupted package (PGP signature))
Errors occurred, no packages were upgraded.
pacman -S glibc
:: Some packages should be upgraded first...
resolving dependencies...
looking for conflicting packages...

Packages (1) archlinux-keyring-20231207-1

Total Download Size:   1.15 MiB
Total Installed Size:  1.64 MiB
Net Upgrade Size:      0.02 MiB

:: Proceed with installation? [Y/n] 
:: Retrieving packages...
 archlinux-keyring-20231207-1-any                                1180.2 KiB   291 KiB/s 00:04 [#######################################################] 100%
(1/1) checking keys in keyring                                                                [#######################################################] 100%
warning: Public keyring not found; have you run 'pacman-key --init'?
error: GPGME error: Invalid crypto engine
(1/1) checking package integrity                                                              [#######################################################] 100%
warning: Public keyring not found; have you run 'pacman-key --init'?
error: GPGME error: Invalid crypto engine
error: archlinux-keyring: missing required signature
:: File /var/cache/pacman/pkg/archlinux-keyring-20231207-1-any.pkg.tar.zst is corrupted (invalid or corrupted package (PGP signature)).
Do you want to delete it? [Y/n] 
error: failed to commit transaction (invalid or corrupted package (PGP signature))
Errors occurred, no packages were upgraded.

resolving dependencies...
looking for conflicting packages...
error: failed to prepare transaction (could not satisfy dependencies)
:: installing glibc (2.38-7) breaks dependency 'glibc=2.37' required by lib32-glibc
[manjaro /]# pacman-key --init
gpg: /usr/lib/libc.so.6: version `GLIBC_2.38' not found (required by gpg)
chmod: cannot access '/etc/pacman.d/gnupg//trustdb.gpg': No such file or directory
gpg: /usr/lib/libc.so.6: version `GLIBC_2.38' not found (required by gpg)
gpg: /usr/lib/libc.so.6: version `GLIBC_2.38' not found (required by gpg)
==> Generating pacman master key. This may take some time.
gpg: /usr/lib/libc.so.6: version `GLIBC_2.38' not found (required by gpg)
==> Updating trust database...
gpg: /usr/lib/libc.so.6: version `GLIBC_2.38' not found (required by gpg)
==> ERROR: Trust database could not be updated.
[manjaro /]# 

I think you botched your system and depending on your skill level, you might be best of with reinstalling instead of fixing.

However, you could try to fix it with pacman-static from a live environment and chrooted.

Setting the signatures to be disabled is a security nightmare and can’t fix anything.

1 Like

What discussions?

What other forums?

Why? Don’t do that.

What other wiki’s and guides?

Always check the Manjaro and Arch wikis before following random “guides” on the internet.

Please see:

1 Like

Hello @iamwaffel360 :wink:

That is a classical partial-update which breaks now core functionality. Really, if you install anything upgrade everything beforehand, otherwise it will break on a rolling-release model.

gpg needs GLIBC_2.38, but installed is a lower version. You can try fixing that on a live session like that:

Start a live session.

  1. Mount your root partition:
sudo mount -m /dev/sda1 /mnt/system

:notebook: Replace sda1 with the appropriate block device. See lsblk --fs

  1. Include system directory:
cd /mnt/system
sudo mount -t proc /proc proc/
sudo mount -t sysfs /sys sys/
sudo mount --rbind /dev dev/
  1. Copy the pacman.conf from the live session into your installation:
sudo cp /etc/pacman.conf /mnt/system/etc/pacman.conf
  1. Then install glibc:
sudo pacman --sysroot /mnt/system -Syy glibc

Should work…

  1. Then try a system upgrade (force refresh and downgrade enabled):
sudo pacman --sysroot /mnt/system -Syyuu

When finished, umount it:

cd $HOME
sudo umount -R /mnt/system
1 Like

Here are a few but i have been looking for a while and across multiple devices as I wanted to learn more as I try to fix it.
Here are a few from my history on this device in no particular order

https://bbs.archlinux.org/viewtopic.php?id=212752
https://bbs.archlinux.org/viewtopic.php?id=289714
https://bbs.archlinux.org/viewtopic.php?id=274705
https://bbs.archlinux.org/viewtopic.php?id=146897

https://superuser.com/questions/788304/where-to-download-missing-libc-so-6

https://wiki.archlinux.org/title/Pacman#Pacman_crashes_during_an_upgrade
https://wiki.archlinux.org/title/Pacman/Tips_and_tricks#Reinstalling_all_packages

I don’t remember where or when but have set it back to

SigLevel    = Required DatabaseOptional

Im looking into it now

I will restart live boot now as it fails

[manjaro manjaro]# mount -m /dev/encryp /mnt/system
mount: /mnt/system: special device /dev/encryp does not exist.
       dmesg(1) may have more information after failed mount system call.

For reference it was loaded with

cryptsetup luksOpen /dev/nvme1n1p3 encryp

Must be then: /dev/mapper/encryp

Adding this for referance

    ~  lsblk -fs                                                                                                                                INT ✘ 
NAME      FSTYPE      FSVER            LABEL            UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
loop0     squashfs    4.0                                                                          0   100% /run/miso/sfs/livefs
loop1     squashfs    4.0                                                                          0   100% /run/miso/sfs/mhwdfs
loop2     squashfs    4.0                                                                          0   100% /run/miso/sfs/desktopfs
loop3     squashfs    4.0                                                                          0   100% /run/miso/sfs/rootfs
sda2      vfat        FAT16            VTOYEFI          301E-EA1C                                           
└─sda                                                                                                       
sdb                                                                                                         
ventoy    iso9660     Joliet Extension MANJARO_KDE_2304 2023-10-15-12-00-38-00                     0   100% /run/miso/bootmnt
└─sda1    exfat       1.0              Ventoy           151E-0EA3                                           
  └─sda                                                                                                     
nvme0n1p1 ext4        1.0                               f7315f61-efde-4a8a-8ebf-a80539db8571                
└─nvme0n1                                                                                                   
nvme1n1p1 swap        1                                 a18f59f6-b026-49f9-81ce-3e2067752985                
└─nvme1n1                                                                                                   
nvme1n1p2 vfat        FAT32                             CDB4-120E                                           
└─nvme1n1                                                                                                   
nvme1n1p3 crypto_LUKS 1                                 52ef1471-0ab8-4ff7-8428-a61f3101beda                
└─nvme1n1                                                                                                   
nvme1n1p4 crypto_LUKS 1                                 facd7af2-0139-4292-acb6-041b7be8325d                
└─nvme1n1      
    ~  sudo cryptsetup luksOpen /dev/nvme1n1p3 encryp                                                                                               ✔ 
Enter passphrase for /dev/nvme1n1p3: 
    ~  sudo mount -m /dev/mapper/encryp /mnt/system                                                                                              32 ✘ 
    ~  cd /mnt/system                                                                                                                               ✔ 
    /mnt/system  sudo mount -t proc /proc proc/                                                                                                     ✔ 
    /mnt/system  sudo mount -t sysfs /sys sys/                                                                                                      ✔ 
    /mnt/system  sudo mount --rbind /dev dev/                                                                                                       ✔ 
    /mnt/system  sudo cp /etc/pacman.conf /mnt/system/etc/pacman.conf                                                                               ✔ 
    /mnt/system  sudo pacman --sysroot /mnt/system -Syy glibc                                                                                       ✔ 
:: Synchronizing package databases...
 core                                                             144.7 KiB   310 KiB/s 00:00 [#######################################################] 100%
 extra                                                              8.6 MiB  7.52 MiB/s 00:01 [#######################################################] 100%
 multilib                                                         143.9 KiB  1894 KiB/s 00:00 [#######################################################] 100%
:: Some packages should be upgraded first...
resolving dependencies...
looking for conflicting packages...

Packages (1) archlinux-keyring-20231207-1

Total Download Size:   1.15 MiB
Total Installed Size:  1.64 MiB
Net Upgrade Size:      0.02 MiB

:: Proceed with installation? [Y/n] 
:: Retrieving packages...
 archlinux-keyring-20231207-1-any                                1180.2 KiB  4.27 MiB/s 00:00 [#######################################################] 100%
(1/1) checking keys in keyring                                                                [#######################################################] 100%
warning: Public keyring not found; have you run 'pacman-key --init'?
error: GPGME error: Invalid crypto engine
(1/1) checking package integrity                                                              [#######################################################] 100%
warning: Public keyring not found; have you run 'pacman-key --init'?
error: GPGME error: Invalid crypto engine
error: archlinux-keyring: missing required signature
:: File /var/cache/pacman/pkg/archlinux-keyring-20231207-1-any.pkg.tar.zst is corrupted (invalid or corrupted package (PGP signature)).
Do you want to delete it? [Y/n] 
error: failed to commit transaction (invalid or corrupted package (PGP signature))
Errors occurred, no packages were upgraded.

resolving dependencies...
looking for conflicting packages...
error: failed to prepare transaction (could not satisfy dependencies)
:: installing glibc (2.38-7) breaks dependency 'glibc=2.37' required by lib32-glibc

Also I found why the SigLevel = Never thing was in my head, as I was able to resolve the issue I had with a new ARM install.

So, to give you some points:

  1. You need to install a gpg version works with your libc.so so that pacman can work. Probably just copy it manually.
  2. You need to configure pacman’s gnupg. Since you didn’t update for a long time, you need to do this manually.
  3. Clean pacman’s cache.

When all of this is done, you try a full system upgrade again.

There are many steps to describe to unbrick it at your stage. Easier would be reinstalling it, really. :man_shrugging: