31

I am trying to install cheese

ubuntu@ubuntu:/usr/src/linux-headers-3.5.0-23-generic$ sudo apt-get install cheese
[sudo] password for ubuntu: 

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 solve this issue please help.

kiri
  • 28,246
  • 16
  • 81
  • 118
user2782858
  • 421
  • 1
  • 4
  • 4

1 Answers1

51

Warning: This should not be the first thing you try. Read the answers on the linked duplicate question before proceeding.


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
wjandrea
  • 14,236
  • 4
  • 48
  • 98
Pensacola
  • 527
  • 3
  • 3
  • 9
    In my specific case I removed the lock here -> sudo rm /var/lib/dpkg/lock - after lock removed it was able to install -> sudo apt-get install libxml2-dev – devasia2112 Mar 31 '16 at 10:03
  • 2
    I still get an error: unable to lock the administration directory /var/lib/dpkg – IgorGanapolsky Jul 24 '16 at 21:01