When you are installing application on ubuntu, you may get this error: Unable to lock the administration directory (/var/lib/dpkg/). In this tutorial, we will tell you how to fix this error.
For example, if you are installing openssh-server on ubuntu.
sudo apt-get install openssh-server
You may get this error:
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?
How to fix this error?
You can run these commands one by one.
sudo rm /var/cache/apt/archives/lock sudo rm /var/lib/dpkg/lock sudo dpkg --configure -a
Then, you can start to install openssh-server again.