Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am new to Linux, can anyone be kind enough to help me know how to install software from the terminal?

I tried to install java by entering the command in the terminal

sudo apt-get install openjdk-7-jdk

but i get errors ,

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 also tried root

su -

but it says that the password is incorrect, so what is root ?

Advance Thanks for the help Guys.

share|improve this question

3 Answers 3

up vote 1 down vote accepted

By using sudo, you are temporarily becoming root for the duration of that command, just like you'd switched to root with su - root, executed the command, and switched back with exit.

Out of the box, Ubuntu doesn't configure a password for root, so you cannot log in as root directly like you're attempting to do with su. You either have to use sudo, or configure a password for the root user. It is recommended that you simply use sudo.

Are you sure you used sudo when trying to run the install command?

share|improve this answer
    
To summarize, are you sure you used sudo when you ran the first command? If so, then maybe another package manager is running at the same time, though this seems unlikely. –  neon_overload Mar 18 '13 at 1:21
    
Thanks, that worked. –  Raviteja Mar 18 '13 at 7:53

About trying to get root, you need to do it via sudo -i not just su. Is your account an admin account or just a user account?

share|improve this answer
    
Check out this post: It might help: askubuntu.com/questions/93217/… and this one: askubuntu.com/questions/15433/… –  RPi Awesomeness Mar 17 '13 at 21:54
1  
sudo su is unnecessary and may provoke permission problems - recommend sudo -i instead. –  guntbert Mar 17 '13 at 22:34

You will get that error if you have the gui (graphic user interface) open. Check the desktop, is synaptic package manager open?

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.