Why Doesnt My Standard Lock Lock Again
The other day, I was about to update my Arch Linux arrangement. When I endeavour to update the organisation, I encountered with "unable to lock database" fault in Curvation Linux. I could not install or remove any packages.
Here is the command that I entered to update my Curvation Linux organisation:
# pacman -Syu
And, It returned the following error:
:: Synchronizing package databases... error: failed to update core (unable to lock database) fault: 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 synchronize whatsoever databases fault: failed to init transaction (unable to lock database) error: could not lock database: File exists if you lot're certain a package director is not already running, you can remove /var/lib/pacman/db.lck
The dazzler of Linux distros is sometimes they will the explicitly display the solution along with the error message. As yous can come across in the above output, it says: "..you can remove /var/lib/pacman/db.lck".
So, I simply deleted the aforementioned file with command:
$ sudo rm /var/lib/pacman/db.lck
Voila! It worked. I tin so able to update, install and remove without any problems.
$ pacman -Syu
Sample output:
:: Synchronizing package databases... core 122.viii KiB 162K/due south 00:01 [######################] 100% extra 1771.eight KiB 249K/s 00:07 [######################] 100% customs 3.3 MiB 256K/southward 00:13 [######################] 100% multilib 163.v KiB 265K/s 00:01 [######################] 100% :: Starting total system upgrade... resolving dependencies... looking for alien packages... Packages (8) ca-certificates-mozilla-iii.22-ane coreutils-eight.25-1 curl-7.47.1-1 gcc-5.3.0-iv gcc-libs-5.iii.0-iv libgcrypt-1.six.five-1 nano-2.5.two-1 pacman-mirrorlist-20160208-ii Total Download Size: 42.79 MiB Total Installed Size: 187.90 MiB Net Upgrade Size: 0.91 MiB :: Proceed with installation? [Y/n] y :: Retrieving packages ... gcc-libs-v.3.0-4-x86_64 12.7 MiB 261K/s 00:50 [######################] 100% coreutils-8.25-1-x86_64 two.1 MiB 262K/s 00:08 [######################] 100% ca-certificates-moz... 363.0 KiB 241K/s 00:02 [######################] 100% curl-7.47.i-1-x86_64 798.3 KiB 263K/s 00:03 [######################] 100% gcc-5.3.0-4-x86_64 26.1 MiB 247K/s 01:48 [######################] 100% libgcrypt-i.6.5-1-x... 403.5 KiB 244K/s 00:02 [######################] 100% nano-2.5.ii-1-x86_64 407.0 KiB 262K/s 00:02 [######################] 100% pacman-mirrorlist-2... 5.3 KiB 408K/s 00:00 [######################] 100% (8/8) checking keys in keyring [######################] 100% (8/8) checking packet integrity [######################] 100% (8/eight) loading parcel files [######################] 100% (8/8) checking for file conflicts [######################] 100% (viii/8) checking available disk space [######################] 100% :: Processing packet changes... (i/8) upgrading gcc-libs [######################] 100% (two/viii) upgrading coreutils [######################] 100% (three/8) upgrading ca-certificates-mozilla [######################] 100% (4/viii) upgrading scroll [######################] 100% (five/8) upgrading gcc [######################] 100% (six/8) upgrading libgcrypt [######################] 100% (7/8) upgrading nano [######################] 100% (eight/eight) upgrading pacman-mirrorlist [######################] 100% warning: /etc/pacman.d/mirrorlist installed as /etc/pacman.d/mirrorlist.pacnew
Hope this helps.
Source: https://ostechnix.com/how-to-fix-unable-to-lock-database-error-in-arch-linux/
25 comments
Deepak Baronial eleven, 2018 - 8:xi am
hey 1000 unable to delete db.lck file. it showing even deceit open.
plz aid me.
Reply
sk Baronial eleven, 2018 - 10:30 am
If your user has sudo permissions, yous can definitely delete that file.
Reply
Alessandro Dec 14, 2018 - x:13 pm
Thanks, this commodity is helpful!
Reply
I use arch btw... February 15, 2019 - six:25 am
Excellent work! My Manjaro install didn't show the location of the lock file, then thank you for the guide!
Respond
islamux June 30, 2019 - 6:58 pm
Thanks , it'southward helpful.
Respond
mahi July 22, 2019 - 1:21 am
now (21.07.2019) information technology does not(((
[… ~]$ sudo pacman -Syu
[sudo] password for …:
:: Synchronizing package databases…
mistake: failed to update core (unable to lock database)
fault: failed to update extra (unable to lock database)
error: failed to update community (unable to lock database)
fault: failed to update multilib (unable to lock database)
error: failed to synchronize all databases
EOF
Reply
Sebastian September 27, 2019 - 12:39 am
Thanks, that brought my organization back!
Reply
jes July 27, 2021 - 10:22 pm
Thanks a lottttt man . It workssss
Reply
IgorT November 4, 2019 - x:56 pm
Thank you sir!
Answer
Jesus Hernandez December 15, 2019 - seven:57 pm
I but had the same problem but without it saying the solution yous got at the buttom. I still tried running your command to delete that file and it worked. Thanks!
Reply
annonoymous March 11, 2020 - 6:24 am
Give thanks YOU SO MUCH IVE BEEN STRUGGLING WITH THIS FOR HOURS :)
Reply
Manish March 20, 2020 - 10:28 pm
$ sudo rm /var/lib/pacman/db.lck
[sudo] countersign for xyz:
rm: cannot remove '/var/lib/pacman/db.lck': No such file or directory
$ pacman -Syu
mistake: you cannot perform this functioning unless you are root.
$ pacman -Syu
error: you cannot perform this performance unless yous are root.
$ sudo rm /vr/lib/pacman/db.lck
rm: cannot remove '/vr/lib/pacman/db.lck': No such file or directory
$
Reply
sk March 21, 2020 - xi:43 am
Check if your user is in sudoers list and so delete the file. In that location is a typo in this line – "/vr/lib/pacman/db.lck". It is var, non vr.
Answer
Harsh Sanmukhani April 22, 2020 - 3:01 pm
thanks it works for me…. :)
Reply
Mohammed May 23, 2020 - 7:17 am
Thank you so much information technology works
Reply
Yash July 12, 2020 - 6:31 pm
I got error : failed retrieving file cadre.db
Reply
sk July 13, 2020 - 11:24 am
Reply
IMM Baronial 26, 2020 - 11:29 am
Hey. I use 'Thunar Root' to open '/var/lib/pacman/' then I delete 'db.lck'
Information technology works for me
Hope this help
Reply
Kunle Apata August 8, 2021 - 10:05 am
Delight how practice y'all utilize Thunar root to delete the lock files.
Thank you lot.
Reply
sk August 8, 2021 - 6:27 pm
Hullo Kunle,
Open Last and run the following command to open up Thunar file manager as root:
pkexec thunar
Browse the file location and delete information technology normally. Delight make sure you have selected the correct file name before deleting information technology.
Respond
Moein from iran September 27, 2020 - 2:26 am
thank you a lot
Respond
btw November 10, 2020 - 4:46 pm
Thx :D <3
Reply
Matthew November 6, 2021 - 7:45 am
No such file or directory error cannot remove assistance
Reply
sk November half dozen, 2021 - 11:32 am
Share the output of the following command:
sudo pacman -Syu
Reply
Sami February xix, 2022 - 4:16 am
Thanks, information technology worked.
Reply