Pacman error "invalid or corrupted package"

this is what I got

alek@Feather Desktop]$ ls -al /var/cache/pacman/pkg/libgpg*
ls: cannot access ‘/var/cache/pacman/pkg/libgpg*’: No such file or directory
[alek@Feather Desktop]$ sudo pacman -U /var/cache/pacman/pkg/libgpg-error_xxx.tar.zst
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)
loading packages…
error: ‘/var/cache/pacman/pkg/libgpg-error_xxx.tar.zst’: could not find or read package

That means that you don’t have that file in your local pacman cache.
That cache is long gone, you cleared it - as I could have read from your first post.

You would need to fetch it manually and then try installing it.
I’m not sure where to get it.
It should be in the core repository.
The server names should be in /etc/pacman.d/mirrorlist

cat /etc/pacman.d/mirrorlist

will list the contents of that file
Use the browser to go to one of them (lose the part of the address starting with $repo …)

… and why did you click on “state” and downloaded a random file
when the repository the file is in is called “core”?
… and is clearly there?

… are you at all serious?

sorry, saw that is was the only downloadable file, had a long night
I found the keyrings, downloading manjaro and archlinux

… and hopefully that file (libgpg-error) also
and while you are at it
gpgme
and
gnupg
could prove to be useful to have later …

downloaded those as well, and followed the steps with

sudo pacman-key --init

and everything installed and upgraded.

Thank you for your help.

good
now all you have to do is to revert the change to
/etc/pacman.conf
revert that to:
SigLevel = Required DatabaseOptional

Cheers!