How To Fix “unable to lock database” Error In Arch Linux

12 Responses

  1. Deepak says:

    hey m unable to delete db.lck file. it showing even cant open.
    plz help me.

  2. Alessandro says:

    Thank you, this article is helpful!

  3. I use arch btw... says:

    Excellent work! My Manjaro install didn’t show the location of the lock file, so thanks for the guide!

  4. islamux says:

    Thank you , it’s helpful.

  5. mahi says:

    now (21.07.2019) it does not(((

    [… ~]$ sudo pacman -Syu
    [sudo] password for …:
    :: Synchronizing package databases…
    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 synchronize all databases
    EOF

  6. Sebastian says:

    Thank you, that brought my system back!

  7. IgorT says:

    Thank you sir!

  8. Jesus Hernandez says:

    I just had the same problem but without it saying the solution you got at the buttom. I still tried running your command to delete that file and it worked. Thanks!

  9. annonoymous says:

    THANK YOU SO MUCH IVE BEEN STRUGGLING WITH THIS FOR HOURS 🙂

  10. Manish says:

    $ sudo rm /var/lib/pacman/db.lck
    [sudo] password for xyz:
    rm: cannot remove ‘/var/lib/pacman/db.lck’: No such file or directory
    $ pacman -Syu
    error: you cannot perform this operation unless you are root.
    $ pacman -Syu
    error: you cannot perform this operation unless you are root.
    $ sudo rm /vr/lib/pacman/db.lck
    rm: cannot remove ‘/vr/lib/pacman/db.lck’: No such file or directory
    $

    • sk says:

      Check if your user is in sudoers list and then delete the file. There is a typo in this line – “/vr/lib/pacman/db.lck”. It is var, not vr.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.