My PHPmyadmin (PMA) install was stuck. I started a new session and when doing apt-get purge phpmyadmin I got:

E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable).

E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?

I ran these in Google and found two issues here; Highest answers suggest removing lock file (as well as it's cached version), but that didn't help:


This answer should be tried as well for Ubuntu 16.04, I would advise to try it second:

cd /var/lib/dpkg/info/
sudo rm -r phpmyadmin.*
sudo apt-get clean
sudo apt-get update
phpdismod mcrypt mbstring
service apache2 restart
sed -i 's/Include \/etc\/phpmyadmin\/apache.conf/ /g' /etc/apache2/apache2.conf 
apt-get purge phpmyadmin -y
apt autoremove
  • Attention: you might have to use sudo in other commands informed above, otherwise you might get "permission denied" message. – Marcelo Ágil Nov 4 '18 at 0:22

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.