Skip to content

Unable to lock database: A Linux Manjaro Story

Posted in Experiences

As you may know, a few months ago I made the acquisition of a PinePhone and today I decided to take a break from my Azure learning to toy around with it. The key thing that motivated me to have a look at it today is an article I read on Edward Snowden’s Substack. The piece dealt with smartphones and security surrounding them or lack thereof. It’s been months since I last touched it and it seems like the updates stopped working. When I tried to run updates from the phone’s UI, I kept getting an “Unable to lock database” message.

Then I tried SSH’ing into the device to try and run an update using the pacman package manager. I still got that “Unable to lock database” error message. However, there is a tad more verbose this time.

Eventually, I used my powerful googling skills and found this simple post archive from Manjaro’s forum. It gave me a solution that feels obvious now but really isn’t when you’re not a Manjaro nerd. Simply delete the database lock file with that command:

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

Lock files can be a pain even outside Linux. I’m guessing that the previous update created the file before the phone ran out of battery and shut down without deleting it. Now that I deleted the lock file the update works.

Writing this post while the system upgrade goes through. Can’t wait to get back to some tinkering with that device. More and more I feel like we need to help develop alternatives to Apple and Android devices. PinePhone might not be the answer. Actually, it is not even ready for use as a daily driver, but it will help build a brighter future. A future where you can build apps that will not get removed at the whims of a corporation or screams from some fringe activists. A better future where the market can actually decide whether your product can thrive or die.

Thank you for reading and I will see you next time! In the meantime, you can check out my previous post about code reviews and first-blood duels.

Cover by Polina Zimmerman from Pexels

One Comment

  1. Anon
    Anon

    I recently got a Pinephone and encountered the same issue. This was really helpful for myself other folks that don’t have experience with Arch-based distros.

    October 6, 2021
    |Reply

Leave a Reply

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

%d bloggers like this: