0

I had to reinstall the entire OS a little while ago and I have been trying to reinstall all of the programs I had before but I got a bit a of a problem now. I was trying to download dropbox from synaptic but it cannot finish the process and as a result I cannot update anything anymore. The line that comes out is:

  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 have tried:

sudo apt-get install -f
sudo apt-get -f install
sudo rm /var/lib/dpkg/lock
sudo apt-get -f update
sudo dpkg --clear-selections
sudo dpkg --configure -a

But nothing seems to work.

So is there a way to solve this??

Thanks

Tim
  • 32,861
  • 27
  • 118
  • 178
  • 2
    try this link in order to view who locks your file. – Lety Aug 23 '14 at 09:39
  • 2
    http://askubuntu.com/questions/15433/unable-to-lock-the-administration-directory-var-lib-dpkg-is-another-process do a search for the error message first. You have something else, like the software centre open. – Tim Aug 23 '14 at 09:39
  • Make sure all package managers are closed (synaptic, software center). This also happens if you cut the system off as it is installing a program (eg close a terminal that is still busy) did you do this, if so which package was installing at the time – Mark Kirby Aug 23 '14 at 10:10

2 Answers2

0

This command should find, identify and kill the proses that has locked dpkg

sudo fuser -vki /var/lib/dpkg/lock; sudo dpkg --configure -a
Mark Kirby
  • 18,529
  • 19
  • 78
  • 114
0

You can run the following commands to remove or install an application.

sudo apt-get -f install

sudo apt-get autoremove

apt-get remove --purge packagename

you can check this post for completely remove an application

msnfreaky
  • 179
  • 3
  • 7