Invalid or corrupted database and unknown trust

I installed a package manually and I deleted for some time. But its signature remained out there and I’m unable to update.

sudo pacman -Syu gives:

error: DEB_Arch_Extra: signature from “******** <support@*********>” is unknown trust
error: failed to synchronize all databases (invalid or corrupted database (PGP signature))

I’ve tried sudo pacman-key --refresh-keys and sudo pacman -S archlinux-keyring with no luck. Isn’t there a way to manually remove that signature?

Try this first:

$ sudo pacman -Sy archlinux-keyring && pacman -Su

It replies with the same error mentioned above.

You can try to manually reset all the pacman keys:

First, remove all current keys

$ sudo rm -r /etc/pacman.d/gnupg

Then, run pacman-key --init followed by pacman-key --populate

This looks coming from an extra repository added to your /etc/pacman.conf. Is it for MegaSync?
You could temporarily disable it and update your system: sudo pacman -Syu

Yep it is for MegaSync. I tried to disable it by adding # on pacman.conf and then update but the same error comes.

[Deb_Arch_Extra]
#SigLevel = Required TrustedOnly
#Server = https://mega.nz/linux/repo/Arch_Extra/$arch

When I don’t import the key:

error: DEB_Arch_Extra: key "B01C811880480C854C73EC7E1A664B787094A482" is unknown
:: Import PGP key B01C811880480C854C73EC7E1A664B787094A482? [Y/n] n
:: Synchronizing package databases...
error: failed to synchronize all databases (no servers configured for repository)

After I imported the key:

error: DEB_Arch_Extra: key "B01C811880480C854C73EC7E1A664B787094A482" is unknown
:: Import PGP key B01C811880480C854C73EC7E1A664B787094A482? [Y/n] 
error: DEB_Arch_Extra: signature from "MegaLimited <support@mega.co.nz>" is unknown trust
:: Synchronizing package databases...
error: failed to synchronize all databases (no servers configured for repository)

Post the whole output of sudo pacman -Syu

Also, format the pasted text by highlighting it and pressing Ctrl-E.

sudo pacman -Syu
error: DEB_Arch_Extra: signature from "MegaLimited <support@mega.co.nz>" is unknown trust
:: Synchronizing package databases...
error: failed to synchronize all databases (no servers configured for repository)

You are not posting the whole output. :wink:

I wanted to see your active repositories. Anyways, MegaSync seems to be still active.

Put # in front of [Deb_Arch_Extra] as well in /etc/pacman.conf.

I couldn’t remove all current keys.

rm: cannot remove '/etc/pacman.d/gnupg/S.gpg-agent.browser': No such file or directory
rm: cannot remove '/etc/pacman.d/gnupg/S.gpg-agent.ssh': No such file or directory

Thanks a lot. Now it works. By the way, What should I’ve avoided to not get into this problem? Is it because I’ve installed the Megasync manually?

Honestly, I am not sure why MegaSync repo occasionally creates issues for users.
There have been similar reported cases before.

One thing you could also try is to import the key from a trusted source “manually” and locally sign it.

See: https://wiki.archlinux.org/title/Pacman/Package_signing#Adding_unofficial_keys

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.