0

I can't install some applications using apt-get.

It shows the following error. How to solve it?

$ sudo apt-get install apache2
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?
Zanna
  • 72,312

1 Answers1

2

This may break things if used carelessly. Try the answers on this question first: Unable to lock the administration directory (/var/lib/dpkg/) is another process using it?

Did you have a problem while you were installing something previously? Your computer may've crashed while apt, apt-get or aptitude was doing some updates and so it left the lock file in the disk.

Try this:

sudo mv /var/lib/dpkg/lock /var/lib/dpkg/lock_backup

Then try to install apache again:

sudo apt-get install apache2

If everything works fine, just delete the backup file:

sudo rm -vf /var/lib/dpkg/lock_backup
wjandrea
  • 14,504