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.
![](https://manaduvortes.com/wp-content/uploads/2022/07/image.png)
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.
![](https://manaduvortes.com/wp-content/uploads/2022/07/image-1.png)
Kill the process “sudo kill 5181”
![](https://manaduvortes.com/wp-content/uploads/2022/07/image-2.png)
Then try re-running the the dpkg command.
![](https://manaduvortes.com/wp-content/uploads/2022/07/image-3.png)