0

I'm getting this error while using sudo apt-get install command

E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it

How do I solve it?

1
  • Probably some background process is running. wait some minutes and try again.
    – Soren A
    Jun 6, 2019 at 8:08

2 Answers 2

0

This should be used as last resort. If you use this carelessly you can end up with a broken system. Please try the other answers first before doing this.

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
sudo rm /var/lib/dpkg/lock

After then, updates the package lists :

sudo apt-get update  

Source

2
  • Hey @efthialex it has been solved my probllem long back by using the above commands, when i tried to installl 'apt-get install vim' same problem occured so that's the reason i shared those here. even i got those commands from google search dont know exactly from where it's quite long back.
    – kaushik
    Jun 6, 2019 at 9:41
  • 1
    @efthialex, your edit was fine and a clear improvement to this post. Thanks! Kaushik, please see the other options mentioned. Yes, this approach can sometimes help, but it should always be the last resort since it can actually break things.
    – terdon
    Jun 6, 2019 at 10:00
-1

You can try to reconfigure all unpacked but unconfigured packages by typing the following into a terminal :

sudo dpkg reconfigure -a
2
  • 1
    Could you please elaborate on how/why this command will fix the problem? It is commonly frowned upon just giving commands without explanations.
    – Soren A
    Jun 6, 2019 at 8:06
  • Although this command might not solve the issue here, have you forgot a hyphen (-) between dpkg reconfigure?
    – Kulfy
    Jun 6, 2019 at 8:52

Not the answer you're looking for? Browse other questions tagged .