Unable to Lock Database
Unable to Lock Database On Arch Linux – I use Asus ROG GL503 laptop. Linux generally has problems when installed on this laptop. The first problem is because this laptop uses an Nvidia graphics card which of course sometimes reboots itself during the install process and likes to freeze because some distributions don’t have the nvidia driver package in the .ISO file.
The second problem is, even though it was successfully installed, I felt overheating in certain parts of this laptop. By the problem, I tried to install linux distributions, hoping to get a linux distro that doesn’t overheat.
Among the distros that I have installed on this laptop are UBuntu (14, 16, 17, 18, 19 20), Lubuntu, Ubuntu Mate, Xbuntu, Linux Mint (Cinnamon, Mate, XFCE), Debian, Linux Lite, Pop Os, KDE Neon, antiX, Elementary OS, Fedora, LXLE, MX-Linux, SparkyLinux, Ubuntu Kylin. Everything Overheated.
Then I tried a few more distros, namely Zorin OS and Manjaro, now I’m happy here. Not too Overheated but still warm which makes it uncomfortable.
Not satisfied because it’s still warm, I looked for linux again and found Linux Endeavaour OS, a bit foreign to my ears at first. And it turns out that this is a derivative of Arch Linux.
I tried to install, it turns out the laptop is not overheating at all.
Some time later I want to update the package to update the application package through the terminal with the command:
sudo pacman -Syu
and an error appears. and the error that appears in the terminal is:
:: Synchronizing package database... 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 endeavouros (unable to lock database) error: failed to synchronize all databases
Cause Error unable to lock database
there is one key file and it should be deleted. the file name is db.lck. the file is in the “/var/lib/pacman” folder.
How to Fix This Error
Delete this “db.lc” file first. How to remove it with the command:
sudo rm /var/lib/pacman/db.lck
after that we try to update the package again with the command:
sudo pacman -Syu
And it works. It can be seen from the output on the terminal image below.
That’s it. Hope this is useful.