1

I am new to Ubuntu and I have used the apt-get and dpkg -i command to install a software via command line quiet a few times. But because of some unknown reasons I am getting some errors, which I couldn't understand

Please tell me the reason and remedy of this problem, Thanks.

E: Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable)
E: Unable to lock directory /var/lib/apt/lists/
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?
Maythux
  • 84,289
Debabratta Jena
  • 177
  • 3
  • 5
  • 14

2 Answers2

1

This means that another process is running which is using apt's package lists. To avoid problems with concurrent access, only one process can hold the lock on these files at once. apt-get and dpkg will show these errors instead.

Is Software Updater (or another Ubuntu package management tool) running in the GUI? If so, close it and try again.

Or you can check for other running apt processes using ps.

These is a similar question here with several more answers on how to check for other processes and either kill them, or remove the lockfile. If you can't easily get the directories unlocked, check here: Unable to lock the administration directory (/var/lib/dpkg/) is another process using it?

M. T.
  • 88
1

The Linux way of installing applications prevent running of more than one process using the packaging tools such as apt-get install/upgrade/dist-upgrade and dpkg -i at the same time.

For that when you are using one of these tools and try to use another tool at same time before the first process has completely closed then you'll have this problem.

To test it,easily try to run a command sudo apt-get upgrade and at the same time try to install some app lets say vim sudo apt-get install vim, you'll see the error.

Maythux
  • 84,289