Problems using terminal

Asked by Richard Reinhart

When entering commands in the Terminal window to install Java, I consistently get the error "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 think this resulted from aborting a previous install before it completed.

Any suggestions?
Thanks

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu update-manager Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#1

The message:

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?

is caused because another program that uses the package system is running. Make sure you're not already running Synaptic or apt-get in the background.

Also, the system periodically checks for updates. While doing this, it triggers the lock that you're experiencing. Within ten minutes, it should have finished.

If you still receive the message, you can try an assortment of these commands to try and get rid of the locks:

sudo killall synaptic
sudo killall apt-get
sudo killall dpkg

or you can also reboot your pc...

Thank you

Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#2

Better... more detailed...

The message:

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?

is caused because another program that uses the package system is running. Make sure you're not already running Synaptic or apt-get in the background.

Also, the system periodically checks for updates. While doing this, it triggers the lock that you're experiencing. Within ten minutes, it should have finished.

If you still receive the message, you can try an assortment of these commands to try and get rid of the locks:

Open a Terminal from the menu Applications → Accessories → Terminal and type:

sudo killall synaptic
sudo killall apt-get
sudo killall dpkg

the system will ask you for a password give your user password when requested, you don't see nothing when you type it, then press enter.

or you can also simply reboot your pc...

Thank you

Revision history for this message
Al Butler (al-butler) said :
#3

This error can occur if you have another package manger open at the same time, such as synaptic or any other program that can install/upgrade packages. If no other package manager running try the following in the terminal:

sudo ps -A | grep aptitude

sudo ps -A | grep apt-get

sudo ps -A | grep dpkg

sudo ps -A | grep frontend

These commands will show if any of these processes are running. Then if they are kill them with command.

sudo kill [PROCESS NUMBER]

if you have to kill dpkg, afterwards you will most likely have to run:

dpkg --configure -a

THat should hopefully resolve your issue.

Can you help with this problem?

Provide an answer of your own, or ask Richard Reinhart for more information if necessary.

To post a message you must log in.