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

PROBLEM:

Some times we get the following error while trying yo install software using apt-get or synaptic packaging manager.
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 can we resolve this?

SOLUTION: 

The problem occurs if we are running another applications like synaptic using the directory.
So, if this is the case close the applications and try run the command again.

You will also get this message if you forget to use  sudo  when executing an apt command.
You can use sudo lsof /var/lib/dpkg/lock to find the process that owns the lock file
Then try to kill the process to remove the lock.

**WARNING**

This should be used as last resort. If you use this carelessly you can end up with a broken system.

You can delete the lock file with the following command:
sudo rm /var/lib/apt/lists/lock


You may also need to delete the lock file in the cache directory.
sudo rm /var/cache/apt/archives/lock


After that try using the apt-get or synaptic again.

Comments

  1. Bonus Codes for the Casinos & Casinos of 2021
    A List of 챗룰렛 Casinos with Bonus Codes for the Casinos of 2021 - Check the Latest Casino 강원 랜드 바카라 Bonuses 룰렛 배당 & Promotions at Top Casino USA Online 포커 디펜스 for 2021. 뉴 포커 디펜스

    ReplyDelete

Post a Comment

Popular posts from this blog

INSTALLING MOBILE PARTNER IN LINUX

How to install OpenVAS 7 in Ubuntu