how to do commonds as root?

Asked by Monica on 2008-09-09

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:
2008-09-09
Last query:
2008-09-09
Last reply:
2008-09-09
Daniele Napolitano (dnax88) said : #1

sudo yourcommad

Then insert your password.

Monica (gipsy1789) said : #2

T

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?

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.

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.

Monica (gipsy1789) said : #6

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

Cheers!

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.

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!