Hello everyone!
This is my first post here, hoping I can get someone to help me understand if this is by design or if there might be configuration issue on my end. For background context, I have been a Windows sys admin for 15 years, have dabbled in various Linux distros over the years but always came back to Windows because it’s what I know. But for various reasons, I’m ready to dedicate myself to Linux, choosing Arch/endeavourOS as my OS.
Before expanding on my issue, here is some information about my system: I have installed eOS Mercury, the new ISO, onto my laptop. I went with btrfs for my ssd, it is encrypted with luks. i use grub as my bootloader so i can take advantage of restoring snapshots from bootloader menu. This concept will help me stay with Linux, so I’m very interested in this. After the install, I installed snapper-support, which contains snapper, pac-scap, and grub-btrfs. I have also installed btrfs assistant as a GUI, just in case.
What Works: I have it all configured, I can see the snapshots in GRUB when I boot. I can successfully restore to said snapshots, and I can confirm that the system is working by testing the removal/installation of neofetch via pacman. Once I confirm that the snapshot rollback worked, I use btrfs to Restore to that snapshot, reboot, choose the usual kernel (LTS), and login. Testing again, confirm that it is working as intended.
The issue: When I run sudo pacman -Syyu, or really any pacman command, I get this response from the terminal:
error: failed to synchronize all databases (unable to lock database)
I have done some research, and it seems like I have to use this command to unlock the db:
sudo rm /var/lib/pacman/db.lck
My research also indicates that I must first check to make sure no other package manager processes are running at the time, to prevent data corruption or other issues.
I am able to verify that no other services which would be problematic are running. I then run the above rm command to get rid of the issue. I then run sudo pacman -Syyu
and it updates fine. I don’t see any “issue” afterward per se, but I feel like this is not correct. I can’t seem to find any verifiable information about this either through the Arch documentation, various google research, or elsewhere.
Would someone be able to shine some light on this issue, why it is happening, if it is preventable, or if there might be a better way to accomplish the end goal? My guess is that I can create a subvolume for /var/lib/pacman/ and exclude it from snapshots, but I am very unsure. Any information is super appreciated!