How to Fix 'E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable)'

In Ubuntu, you may sometimes encounter an error when attempting to run an apt command:

E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable) E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?

Pre-requisites

Fix

ps aux | grep -i -E ‘apt|dpkg’

kill -9 ps aux | grep -i -E 'apt\|dpkg' | grep -v grep | awk '{print $2}'

sudo rm /var/lib/dpkg/lock sudo rm /var/lib/apt/lists/lock sudo rm /var/cache/apt/archives/lock

comments powered by Disqus