/var/lib/pacman/db.lck is present but nothing happens. can't update


Lately I have been getting this more often when trying to update manjaro…
I just rebooted to try to fix it but it didn’t fix.

when I try to update the system straight after a fresh reboot with:
yay -Syu

everything goes fine, it downloads a bunch of stuff and then in the end it says in terminal:

 -> /var/lib/pacman/db.lck is present.
 -> There may be another Pacman instance running. Waiting...

I’ve been waiting for 30 minutes already and the reason I rebooted was because of the same notification the last time I tried to update.

It pisses me off.

I also tried to update in pamac GUI, same issue:

Waiting for another package manager to quit...

I know I can just remove the lock file and try again and it will probably work
sudo rm /var/lib/pacman/db.lck

but I does not feel good to do so because maybe some other system (pacman?) is trying to update automatically in the background and maybe the update aborts and it may cause issues.

So my questions are;

  1. Why do I get this all of a sudden all the time? I barely had this before in the last 8 years I’ve been on Manjaro. What has changed that caused this annoying bug?

  2. Which setting is causing this annoying updating in the background and overrides my yay -Syu command? Why does yay -Syu not write a lock file? or is the lockfile of yay being ignored by some other updating process?

  3. Can I just safely sudo rm /var/lib/pacman/db.lck every time this happens and try updating again?

sorry for the rant, just annoyed.

If it occurs right after boot, then it’s probably Pamac (aka Add/Remove Software) checking for updates in the background.

You have the right idea about not deleting it. The only time I’ve ever had to delete it was when the update process was interrupted by a crash or something.

1 Like

Do you have another package manager like pamac or some version, like a tray notifier, running ?


Yes, I have pamac and a tray notification showing me when updates become available. I have turned automatic download of updates on in pamac.

I also have yay installed.

I think I just need patience, I think it’s running in the background and my internet is just slow.

Then that is why.
Choose one or the other… or if you want pamac stuff running all the time … close it before running yay.


This topic was automatically closed 3 hours after the last reply. New replies are no longer allowed.