Whenever I try to install anything in Terminal, it returns 'E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?'

Asked by Edward Lowe

I tried to install Ubuntu restricted extras, and it gave me a copyright notice, with an 'Ok' at the bottom, I couldn't click it due to it being recognised as text, so I killed the process in closing terminal, now, if I try to install anything, it returns 'E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?'.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
actionparsnip
Solved:
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

How did you try and install the package?

If you have updates running, let them finish?
If you have a GUI package manager then close that
You can also reboot and try again.

Make sure you run:

sudo apt-get install ubuntu-restricted-extras

So that it installs as root (required).

Revision history for this message
Best actionparsnip (andrew-woodhead666) said :
#2

If none of that works then run:

sudo fuser -vki /var/lib/dpkg/lock;sudo dpkg --configure -a
sudo apt-get install ubuntu-restricted-extras

And you should be OK

Revision history for this message
Edward Lowe (flibberfire) said :
#3

That solved my problem, thank you very much Andrew.

Revision history for this message
Edward Lowe (flibberfire) said :
#4

Thanks actionparsnip, that solved my question.