0

I tried to install ubuntu-restricted-extras using the terminal, but a "Microsoft Eula" screen poped up and I closed the terminal (now I know I should not have done it). After failing to "click" on the "ok" option of such screen. The result is that I broke apt-get... I tried apt-get install -f and also apt-get remove -f but it did not work.

jan@jan-Satellite-C855:~$ apt-get install -f
E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?
jan@jan-Satellite-C855:~$ apt-get remove -f
E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?

I read the article "What to do when apt-get fails" but nothing worked...

So, what should I do now?

Luís de Sousa
  • 13,227
  • 26
  • 81
  • 128

2 Answers2

0

From the code you shared, you are not executing apt-get as root. Try this:

jan@jan-Satellite-C855:~$ sudo apt-get install -f

or you could switch user to root and then run it:

jan@jan-Satellite-C855:~$ sudo -s
[sudo] password for jan:
root@jan-Satellite-C855:~# apt-get install -f
0xSheepdog
  • 340
  • 3
  • 16
0

The error you are receiving simply means you do not have permissions to run apt-get. If this is a vanilla Ubuntu install, then there is no root user, to use apt-get with user jan you must do it with sudo:

sudo apt-get install -f

Another possible reason for this error is the existence of another process looking /var/lib/dpkg. Both the Software Centre and the Package Manager do it, you should always close them before using apt-get in a terminal.

Luís de Sousa
  • 13,227
  • 26
  • 81
  • 128