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