1

Every time I run a command I get this back.

E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied)
E: Unable to lock directory /var/lib/apt/lists/
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?
christopher@christopher:~$

This didn't start happening until I changed my device name.

Seth
  • 58,122
Joel
  • 23

3 Answers3

1

This part from the error message says everything: ...are you root?

So, use:

sudo your_command_here

This is the way, in general, to run a command as root.

See also man sudo.

Radu Rădeanu
  • 169,590
0

This error is due to root privileges.

certain commands require root privileges to run. so use sudo before the command. For further information use manual page of sudo.Type the following for manual page.

man sudo

it give you a detailed information about sudo.

Avinash Raj
  • 78,556
Dpk
  • 1
0

The action your are trying to do have to start from root directory and a normal user cannot access root directly with normal powers. So he needs root powers to access the root folders and he can do it with command sudo.

so execute your command with sudo before it or turn into with sudo -i and then run in it. both will do the same.

If you want to more about Root and sudo Then click here

Raja G
  • 102,391
  • 106
  • 255
  • 328