dpkg: error: dpkg status database is locked by another process

In our case there was no running process (PID) so I hard-stopped and rebooted the VPS.

Next, there are several lock files that might need to be removed:

sudo rm /var/lib/dpkg/lock
sudo rm /var/lib/dpkg/lock-frontend
sudo rm /var/cache/apt/archives/lock

Then you can fix dpkg as suggested:

sudo apt update
sudo dpkg --configure -a

你可能感兴趣的:(database)