"Pacman is currently in use, please wait..." After restoring BTRFS snapshot

Hello,
I have setup grub BTRFS snapshot on my device. To restore, I boot into the snapshot using grub and then run BTRFS assistant to restore it and reboot the system. But after restoring when I try to do anything with pacman, I get, “Pacman is currently in use, please wait…”.
I know I can remove the lock. CachyOS hello app even have the option remove the lock which is nice. But I wonder why it happens after a restore. Is this normal? Can something go wrong in the system? I previously used openSUSE Tumbleweed’s snapshot feature which always worked smoothly. But this issue of “Pacman is currently in use, please wait…” happens for me in both of vanilla Arch and CachyOS.

Purely guess here, but perhaps because typically snapshots are made when pacman is running/pre-run? Ie, so the lock is present?

Hmm that sounds logical, I guess. Would like to know if it happens for everyone who uses snapshot.

yeah it is normal when restoring a snapshot that was automatically created when you use pacman since pacman is running at the time the snapshot is taken so therefore the lock file exists at that point in time when the snapshot is made… Basically all you do is run the following command:

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

Also you can use the option in CachyOS Hello in the Apps/Tweaks page there is an option that says “Remove db lock” which basically types that command for you.

2 Likes

Thanks for confirming this. Now I can keep using without worrying about it.