Ubuntu: Issues running commands [duplicate]



Question:

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.


Solution: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.


Solution:2

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.


Solution:3

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


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »