1

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.

Rafał Cieślak
  • 20,204
  • 7
  • 56
  • 86
Raviteja
  • 13
  • 1
  • 3

2 Answers2

1

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?

IlluminAce
  • 817
  • 5
  • 9
  • 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. – thomasrutter Mar 18 '13 at 01:21
-1

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

wlraider70
  • 1,663
  • 13
  • 26