Arch Linux: Pacman unable to lock database


Cause of the problem

Such as system crashed or power shortage while the pacman is still running. This cause the file db.lck is still present.

The “db.lck” file

The db.lck file is located in /var/lib/pacman/db.lck. Remove this file to solve this problem.

Source: pacman: “unable to lock database”