The problem:

The solution:
sudo rm /var/lib/pacman/db.lck removes the lock of the package database that pacman created when a package is about to get altered. This mechanism prevents a different instance of pacman to perform simultaneous changes but the lock can sometimes remain stale

More about pacman troubleshooting: https://wiki.archlinux.org/title/Pacman#Troubleshooting




