Problem

sudo pacman -Syu
:: Synchronizing package databases...
error: failed to update core (unable to lock database)
error: failed to update extra (unable to lock database)
error: failed to update community (unable to lock database)
error: failed to update multilib (unable to lock database)
error: failed to update anarchy (unable to lock database)
error: failed to synchronize any databases
error: failed to init transaction (unable to lock database)
error: could not lock database: File exists
  if you're sure a package manager is not already
  running, you can remove /var/lib/pacman/db.lck

04

Solution

sudo rm /var/lib/pacman/db.lck
sudo pacman -Syu

References

  • https://www.ostechnix.com/how-to-fix-unable-to-lock-database-error-in-arch-linux/