When you try to install a program via Synaptic or Terminal on Linux systems, you may sometimes get (/var/lib/dpkg/).
How to Resolve /var/lib/dpkg/ in Ubuntu
This error prevents you from installing a program from the Linux repositories. It usually occurs in a concurrent program installation. For example, if you’re using Ubuntu and you get this error when you try to install a program with APT, all you have to do is delete this folder.
I encountered this error while installing GNS3 IOU using apt on Ubuntu. In addition, the application you are trying to install may be different.
If the error you receive when trying to install software on Linux is as follows, we will solve the error (/var/lib/dpkg/lock) in this article.
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?
Follow these steps to resolve this issue.
Step 1
First, open Terminal on the Ubuntu desktop, type the command below, and press Enter.
sudo rm /var/lib/dpkg/lock
After executing the above command, try to install the program again. If you get the same error again, go to step two.
Step 2
In this step, perform the following command in Terminal to force a reconfiguration of Ubuntu packages.
sudo dpkg --configure –a
Try installing the program in Terminal again. Most likely, it will resolve. If you reencounter the same error, go to step 3.
Step 3
This time, try to resolve this issue by executing the following commands in Terminal. Then, try to install the program again. As a result, it will now resolve.
sudo rm /var/lib/apt/lists/lock
sudo rm /var/cache/apt/archives/lock
Conclusion
In this article, we have examined step by step how to troubleshoot “Unable to lock the administration directory” on Linux. Thanks for following us!