I've performed the following actions:
root# rm /tmp/pacman.lck
root# ll /tmp/pacman/lck
ls: /tmp/pacman/lck: No such file or directory
root# pacman -Ql tcl | less
root# pacman -Q
error: unable to lock pacman database.
if you're sure pacman is not already running, you
can remove /tmp/pacman.lck
root# ll /tmp/pacman.lck
---------- 1 root root 0 Dec 23 19:27 /tmp/pacman.lck
It seems that the lock is not removed in certain cases...
It happens (at least for me!) quite often when I'm using pacman with pipes.
Does someone already faced the same mystery?
Actually, i never had this problem, so this is a lucky guess:
Let's say you do this:
pacman -Ql xfree86 |less
and then press ctrl-c to exit. Then less is terminated by a non-default exit signal. Pacman too, so, it exits without removing the lock file. If this is the case, just exit less rightly by pressing 'q'...
In fact, I'm exting less by using 'q' command ... but the lock is not removed.
And it happens even after a fresh reboot...