That means another process is running. Run this command: sudo rm /var/lib/pacman/db.lck
then run sudo pacman-mirrors -f5 && sudo pacman -Syyu
Then reboot and all should be back to normal.
I had edited permissions to “yes” to stop pamac asking for password but pamac gave authentication error.
so I wanted to change it back and assumed it would be recreated after deleting.
I have tried removing db.lock and pacman-mirrors as you suggested.
rm: cannot remove '/var/lib/pacman/db.lck': No such file or directory
mirror list generated successfully and and rebooted.
as I said before pacman works just fine but pamac only can use AUR now.