dpkg: error: dpkg frontend is locked by another process

I came across this error “dpkg: error: dpkg frontend is locked by another process” whilst working with Nessus/Tenable and trying to get an agent deployed, but it caught me off guard because I had nothing else running on the machine and couldn’t quite understand how the dpkg could be locked up.

dpkg frontend lockup

Never the less to fix this, I had to identify what package/process was locking up dpkg, so to do this I ran the following and then killed it off.

Run “sudo lsof /var/lib/dpkg/lock-frontend” and you’ll hopefully see the process. For me it was process ID 5181.

find dpkg locked up process

Kill the process “sudo kill 5181”

Kill the PID

Then try re-running the the dpkg command.

dpkg Nessus Agent