• [Solved] Cannot lock database error.


    Hi all,
    I see available updates but cannot run them as I keep getting this “cannot lock database error.” How do I fix this? Thanks.

  • Hi

    I assume you get the error: failed to init transaction (unable to lock database)
    error: could not lock database: File exists
    If you’re sure a package manager is not already running, you can remove /var/lib/pacman/db.lck:

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

    The alternative is to open PacmanXG as su or sudo, click on ‘Tasks’ then ‘Update system’. You will then get the same error message. There is a box at the bottom of the screen to ‘Delete db.lck’, simply click on this.

  • @Xler8 Awesome! That did the trick, thank you.

  • Just as an FYI - this happened on my laptop with an established install on it and today after a FRESH install on my PC before any new add ons.

  • @Uzi: Which program are you using to manage your updates? pamac? pacmanxg? pacman in the terminal?
    I ask so that we can pinpoint the problem :grimacing:

  • Hi Karasu,
    1st off can I say after checking out MANY distros (Zorin, Ubuntu, PCLos, SolydX, Pinguy. Sabayon, Mageia, Manjaro etc) Antergos is the most complete, reliable distro of them all/ Been using as my #1 for over a year & will not be changing.

    Now to your question. I stopped using PacmanXG a few weeks back as it kept freezing everything. I use either Pacman terminal or the new ‘Add/Remove Software’ tool. That said this latest error was created after new installation reboot, so totally fresh. I used the Minimal 64 bit ISO.

  • @Uzi Thanks! Will do some checks asap…

  • <blockquote>That said this latest error was created after new installation reboot, so totally fresh. I used the Minimal 64 bit ISO.</blockquote>
    Yes, same here.

    Seems like
    sudo rm /var/lib/pacman/db.lck
    fixed the issue. At least for now…

  • Hi,

    Pamac had a bug that in some cases left that file created (if I recall correctly). It seems they already fixed it.

    Cheers!

  • @karasu said:

    Hi,

    Pamac had a bug that in some cases left that file created (if I recall correctly). It seems they already fixed it.

    Cheers!

    I did a fresh install today & it did it again. Easy to fix but still a bug.

  • I am still experiencing this issue multiple times a day on a fresh install.

  • I’m also getting this error regularly. The install is just a few days old. I installed with minimal 64 iso and mate desktop. I use the update manager, pamac and yaourt.

    Thanks

  • @frabato56 I’m quite positive that pamac is the culprit. I say quite because I don’t have any proof, just that I do not use pamac and have not experienced this issue.

    As it is not a critical issue, let’s wait a bit until a new pamac update arrives, if it’s not solved, I’ll do some tests and report them to the developer.

    Cheers!

  • Hi. I am having the same issue and it wasn’t resolved by removing the lock file. Add/remove and Software updater both have this issue. I am not sure how to run those other softwares as admin, since a simple sudo + <name of software> (e.g. pacman, paman, etc.) doesn’t work. I installed from the full amd64 iso (~1.5 GB) released I believe 2015.04.12.

  • Have you tried this?
    open PacmanXG as su or sudo, click on ‘Tasks’ then ‘Update system’. You will then get the same error message. There is a box at the bottom of the screen to ‘Delete db.lck’, simply click on this.

    1.Antergos Linux KDE plasma / Gnome 2.Ubuntu 17.10 64bit Unity
    Intel Core2 Duo CPU P8400 2.26GHz‖ RAM 3908 MiB ‖ Dell Inc. 0F328M - Dell Inc. Latitude E6500
    Intel Mobile 4 Series Chipset Integrated Graphics [8086:2a42] {i915

  • @anarch Hi there. How can I do this exactly? Sorry, I ask because running sudo pacmanxg did nothing in terminal.

  • @anarch That’s a bit of an unnecessarily convoluted solution. @Vartan-Haghverdi run the following in your terminal emulator of choice.

    sudo rm /var/lib/pacman/db.lck
  • @Vartan-Haghverdi To run a program in the terminal, you need to provide the full name. For PacmanXG, I believe that it is “pacmanxg4”.

  • After not seeing this issue for over a month now, today it happened again.

    Yesterday, after not having logged into Antergos for a while, I got a notice about available upgrades. Over 300 MB of new packages which was to be expected of course. However, I had not much time and needed to do some urgent work that needed bandwidth so while new packages where being downloaded (taking away just about all of our measly ADSL connexion) I decided to Cancel the upgrade process and leave it for later. After I was done, I did a full shutdown.

    Today, booting into Antergos again, I got the upgrade notice again but this time the “Cannot lock database error” occurred.

    Hope this will help to reproduce and finally fix the bug :)

  • Hi,

    Manjaro devs (pamac developers) are very aware of this:

    https://github.com/manjaro/pamac/issues/5
    https://github.com/manjaro/pamac/issues/10
    https://github.com/manjaro/pamac/issues/25

    Some of them are closed, though. :cry:

    Cheers!

clock6 Posts 20Views 6680
Log in to reply