Pamac returns error while performing database update (could not lock the database)

After an update of pamac via pacman, I am having problems when trying to install or update applications, when I do both by terminal (Konsole) or via GUI, returns me the following error:

“Warning: Compiling packages as a dynamic user
Warning: Setting the build directory to /var/cache/pamac
Preparing…
Synchronizing package database…
could not lock the database
Failed to synchronize databases
Nothing to do.
Transaction completed successfully.”

I couldn’t find solutions on the Internet for this case. But I can use the pacman when necessary…

Pamac 10.4.1-1 - libpamac 11.3.1-1

1 Like

I may have not paid attention - but I don’t remember seeing this before
… may be a clue, don’t know

but for

could not lock the database

there surely are many … many references

Probably the database is already locked

Try:

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

Then again, use pamac update

I suggest you to check if there isn’t any running pacman process before aswell, avoid conflicts with your package manager :smiley_cat:

2 Likes

I have found this error sometimes pops up if there are .part files in /var/lib/pacman/sync

to remove them use sudo rm /var/lib/pacman/sync/*.part

1 Like

I started getting this same issue. it wasnt the most recent update it was shortly before that. been a couple weeks. But my pamac still works fine. it just throws that error message. Every time i install something it will throw the “cant lock database” error, then i click OK and then everything starts downloading and installing just fine so. idk if theres an issue or not really.

Well, the solution found was to delete all files within the directory using:

sudo rm /var/lib/pacman/sync/* 

And then perform a full update by:

sudo pacman-mirrors -f5 && sudo pacman -Syyu

With the initial deletion, several packages were outdated and the steam runtime was removed, but then only reinstall that everything goes back to normal.

I had some errors with the first try, due to keys that could not be checked, but after trying again and restarting the system, it worked.

Thanks guys for the tips without them would not have come to this solution :slightly_smiling_face:

I don’t know about your case, but with me I didn’t receive updates via tray-icon in pamac, every time I had to run through the terminal and confirm using pacman.

no i seem to be able to do both with no issue at all. i just get the locked database error for some reason its pretty weird. actually when i use pacman i dont get the error at all just pamac. both still work fine tho.

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