how to do commonds as root?

Asked by Monica

I am a new user of Ubuntu, and I'd like to install some software with APT, but system shows an error that " are you root?". I set a login user as 'administrator', so how can I change to Root? P.S:the Error as: "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?"

Thank you !

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu gnome-terminal Edit question
Assignee:
No assignee Edit question
Solved by:
Deepak Mishra
Solved:
Last query:
Last reply:
Revision history for this message
Daniele Napolitano (dnax88) said :
#1

sudo yourcommad

Then insert your password.

Revision history for this message
Monica (gipsy1789) said :
#2

T

Revision history for this message
Monica (gipsy1789) said :
#3

I did what you said, and have made sure the command and password were correct, but after insert my password, the system showed the error I just mentioned.
What I did as belows:
administrator@administrator-laptop:~$ apt-get install dhcp3-client dhcp3-common dhcp3-relay dhcp3-server (then insert my password)
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?

Revision history for this message
José Ernesto Dávila Pantoja (josernestodavila) said :
#4

Monica, the right way to do that is:

sudo apt-get install dhcp3-client dhcp3-common dhcp3-relay dhcp3-server

then you insert your password and that's it.

Revision history for this message
Best Deepak Mishra (dpux) said :
#5

you should use the command :
sudo apt-get install dhcp3-client dhcp3-common dhcp3-relay dhcp3-server
then , it will ask you for your password (you will not see anything when you type)

also make sure that you have not opened any other graphical tool for installation like add/remove or synaptic.

Revision history for this message
Monica (gipsy1789) said :
#6

OK, thank you all very much. I've added 'sudo' then the problem had been solved.

Cheers!

Revision history for this message
Prasanth (prbharadwaj) said :
#7

Hi,

When i did like above, i am getting the following error:

Couldn't find package dhcp3-relay..
Also please tell how to change the file permissions.

Please suggest.

Revision history for this message
Steve (stupendoussteve-deactivatedaccount) said :
#8

This is a very old question that has already been solved.

Please create a new one and include exactly what you are trying to accomplish and having problems.

Thanks!