With a fresh install of the Arch’s package manager pacman the user might not be able to open its databases located in /var/lib/pacman/sync .
error: could not open file /var/lib/pacman/sync/testing.db: Failed to open '/var/lib/pacman/sync/testing.db' error: could not open file /var/lib/pacman/sync/core.db: Failed to open '/var/lib/pacman/sync/core.db' error: could not open file /var/lib/pacman/sync/extra.db: Failed to open '/var/lib/pacman/sync/extra.db' error: could not open file /var/lib/pacman/sync/community-testing.db: Failed to open '/var/lib/pacman/sync/community-testing.db' error: could not open file /var/lib/pacman/sync/community.db: Failed to open '/var/lib/pacman/sync/community.db' error: could not open file /var/lib/pacman/sync/multilib.db: Failed to open '/var/lib/pacman/sync/multilib.db'
In a bug report someone filed this description:
Pacman 3.5.0 sets the db files according to the umask, which can make them not world readable and hence users might need root privileges to search the db. This is a change since <3.5, since then everything needed to search for packages was set world readable.
After executing pacman -Syy the databases were accessible.