[root tip] [How To] Mitigate and prevent GPGME error when syncing your system

You are getting a message when syncing your system

error: GPGME error: No data
error: failed to synchronize all databases (invalid or corrupted database (PGP signature))

Before you continue

This reference is the troubleshooting process I went through when I discovered the issue which was affecting my public mirror service (not official).

Pacman looking for database signature files

Also see this pacman bugreport from 2015 - which was closed as not a bug but a matter of configuration.

TL:DR

Open the file /etc/pacman.conf in a terminl editor (nano, micro, vi) and locate the following section

# By default, pacman accepts packages signed by keys that its local keyring
# trusts (see pacman-key and its man page), as well as unsigned packages.
SigLevel    = Required DatabaseOptional
LocalFileSigLevel = Optional
#RemoteFileSigLevel = Required

Change the SigLevel to

....
SigLevel    = Required DatabaseNever
....

Remove the files in /var/lib/pacman/sync - they will be fetched as necessary

sudo rm -f /var/lib/pacman/sync/*

Change mirror

sudo pacman-mirrors --continent

A shortcut

The following is a reference to an utility script by @megavolt capable of doing the heavy lifting for you

[HowTo] Work around gpg verification issue on left behind systems

The explanation

It is a matter of configuration.

The setting in pacman.conf instructs pacman to look for optional database signature files. Neither Archlinux nor Manjaro signs the database - only the packages. Signing the database is rare but do exist and an example of an entity signing the database is SublimeHq (sublime text and sublime merge).

Pacman defaults to an internal downloader to retrieve files from the mirror.

When pacman wants a db.sig file it requests the signature file.

The mirror can answer with 200 which will make libalpm save the content received OR the mirror can respond with 404 which will do nothing and no error messages is thrown as there is no file to be read.

Some mirrors responds to 404 with 200 and some html.

Such responses will be written as the signature file and libalpm will validate the database with the received data and the validation - of course - fails.

If you look into the folder /var/lib/pacman/sync you will most likely find several db.sig files with identical timestamps and size.

If you take a closer look they are text files having html content

$ file /var/lib/pacman/sync/*.db.sig
core.db.sig: HTML document, ASCII text
...

When using the default

SigLevel    = Required DatabaseOptional

there is only way to mitigate the above and it is to set the following in pacman.conf.

SigLevel    = Required DatabaseNever

There is no security problem with this as the packages are signed and the SigLevel for the repos are usually set to PackageRequired as seen from below example

[core]
SigLevel = PackageRequired
Include = /etc/pacman.d/mirrorlist

You can safely remove the files in /var/lib/pacman/sync as they will be fetched as necessary.

sudo rm -f /var/lib/pacman/sync/*

If - despite the above configuration - the messages continues - you will need to remove the files one more time and change mirror. This is easily done using the pacman-mirrors command

sudo pacman-mirrors --continent

Rerun your sync command (force metadata reload)

sudo pacman -Syyu
36 Likes
Error: failed to synchronize all databases (invalid or corrupted database (PGP signature)) after SCP failure
Error: GPGME error: No data after fresh install
"gpg: error reading key: No public key" when updating manjaro-keyring
GPGME error: No data & failed to synchronize all databases (invalid or corrupted database (PGP signature))
Pacman error during update
Can't install package(s) - getting “GPGME error: Invalid crypto engine”, "missing required signature" and pacman package cache file "is corrupted (invalid or corrupted package (PGP signature))"
My system cannot update :/ not sure how to fix
Upgrade using pamac causes "GPGME error: No data"
ERROR failed to synchronize all databases (invalid or corrupted database (PGP signature))
Getting errors when trying to update with pacman from the terminal but not when using Gnome GUI
ERROR failed to synchronize all databases (invalid or corrupted database (PGP signature))
Error: multilib.db: GPGME error: No data
Cannot update because of GPG problems
I'm trying to installed unreal engine
[Unstable Update] 2021-11-24 - ICU 70.1 rebuilds, VirtualBox 6.1.30
Community Repo Packages not available in Pamac
"Impossible de synchroniser les bases de données"
I can't install any software through Add/Remove software
Issues while updating/upgrading system (Error: GPGME Error: No data)
Comments: Mitigate and prevent GPGME error when syncing your system
Comments: Mitigate and prevent GPGME error when syncing your system
Hello, can't install Openbox
Unable to update (key issues / corrupted packages)
Package Manager Issues With Circle by Disney
I get error: failed to synchronize all databases (invalid or corrupted database (PGP signature))
How to solve ERROR: failed to synchronize all databases (invalid or corrupted database (PGP signature))
Black screen on boot,
Discord Update / Error
[Stable Update] 2021-12-16 - Kernels, KDE Gear 21.12.0, Gnome Extensions, LibreOffice
Discord Update / Error
Unable to install Sway - Unknown trust for PGP key
Manjaro.gpg broken?
Upgrade using pamac causes "GPGME error: No data"
Pamac issue “error: GPGME error: No data"
Erro de Atualização
GPGME error: No data failed to synchronize all databases (invalid or corrupted database (PGP signature))
Manjaro live - Comment accéder au hdd interne?
Signature error
GPGME error: No data
Update fails; invalid or corrupted database (PGP signature)
Invalid or corrupted database (PGP signature)
Cannot update pacman
Cannot update pacman
Corrupt package or non valid
/usr/lib/libc.so.6: version `GLIBC_2.34' not found
I'm having a strange issue with PGP signature
Error: Failed to prepare transaction: invalid or corrupted database
Fehlermeldung beim updaten "Fehler: GPGME error: Keine Daten"
[Unstable Update] January 2025
Pamac update fails, while pacman succeeds
GPGME Failure for updates
Can't Update System & Apps - Hangs
Pamac 10.3.0-1 invalid or corrupted package Clean preinstall
Pacman error: failed retrieving file 'core.db' from mirrors.piconets.webwerks.in
GPGME errors when using pacman
After the latest update on my Pinebook Pro my internet won’t work
Can't update: error: GPGME error: No data
Pamac AUR packages to update does not match with yay
Problem with multilib.db, PGP, can't update with pamac
Problems with pacman (GPGME error & manjaro failed to update all databases (pgp signature))
Pamac Error: multilib.db GPGME error but pacman works
Updating command "sudo pacman -Syu" fails
Updating command "sudo pacman -Syu" fails
Updating software after first bootup
I cant update/install discord
Error running pamac update: invalid or corrupted database
Used months-old ISO installer. Can't update: PGP corrupt
Dropbox: package missing required signature
PC will no longer boot after following interrupted upgrade/update instructions
Pamac GPGME hatası: Veri yok hatsı
Pamac gui software center - reset to "factory defaults"
KDE unstable "error: GPGME error: No data"
KDE unstable "error: GPGME error: No data"
KDE unstable "error: GPGME error: No data"
Error: failed to commit transaction (invalid or corrupted package (PGP signature))
Problema para actualizar paquetes en mi pc
Updating packages with Pamac fails
Corrupted package manager
Error: failed to synchronize all databases (invalid or corrupted database (PGP signature)) error
Invalid or corrupted database
Pamac is behaving strangely
Gnome doesn't start, no gdm.service, broken software databases
Problems with updating the system
Gnupg conflict with updating packages
Invalid or corrupted database when updating
"error: GPGME error: No data" even after turning off all signature checks
Pamac-checkupdates seems to be hyperactive
Pacman - GPGME Error
Ventoy shown in AUR updates while it is in officiall repo
Unable to update - synchronize database error
I can't update AUR and other packages in Pamac
GPGME Error No data
[root tip] Topic Collection List View
PGP errors when trying to update. Can't update fresh install
error: GPGME error: No data help
Gpg: /usr/lib/libc.so.6: version `GLIBC_2.38' not found (required by gpg)
PGP-Signature Error - can't update
AUR Behaves Like Official Manjaro Repository in Pamac
Pacman-mirrors-5.3-1 is corrupted
Pacman all databases seem to be corrupted or invalid
Pamac update with AUR stuck in an infinite loop with wxcommon-light/wxbase-light
Can't update or install software: invalid or corrupted database
Comments: Mitigate and prevent GPGME error when syncing your system
I am currently unable to download/install anything using pamac
PGP signature keys error after even refresh pacman keys
Stable update 2024-07-16 fails
Error: archlinux-keyring: signature from is unknown trust
Pacman and Flatpak stopped working,
Regular GPGME errors blocking app installs / updates
Error updating packages/softwares and etc
Cant install packages with pacman
Comments on 'Mitigate and prevent GPGME error when syncing
Comments on 'Mitigate and prevent GPGME error when syncing
[Stable Update] 2025-03-05 - Kernels, Plasma 6.3, COSMIC Alpha 6, LibreOffice
"GPME error" and "failed to synchronize all databases" (PGP signature problem)
Got scary error message on first update, but forum saved me
Errorswith package manager on fresh install
No way to update - GPGME error: no data
[Stable Update] 2025-03-30 - Kernels, GNOME 48, Mesa, Plymouth, LibreOffice
I can't update manjaro kde
Question about the GPGME SigLevel fix
Database problems persist
Beschädigte Datenbank (PGP-Signatur)
Trouble updating
Update Fehler, bzw. Probleme
Pamac build AUR package stuck in an infinite loop with wxcommon-light/wxbase-light
"invalid or corrupted database"
Corrupted package(s) - but pacman cache is empty
Cannot install cockpit-docker
Pacman is not updating
Cant download any package

A post was merged into an existing topic: Discord Update / Error

10 posts were split to a new topic: Comments on 'Mitigate and prevent GPGME error when syncing

If you have comments or questions use the above thread or create a new topic linking back

https://forum.manjaro.org/t/84700