Sunday, May 5, 2024
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 2611  / 1 Year ago, mon, may 8, 2023, 1:27:04

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.


More From » installation

 Answers
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?


[#32159] Tuesday, May 9, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ndeecru

Total Points: 109
Total Questions: 128
Total Answers: 117

Location: Czech Republic
Member since Thu, Aug 11, 2022
2 Years ago
ndeecru questions
Mon, Jun 20, 22, 04:53, 2 Years ago
Thu, Mar 10, 22, 18:53, 2 Years ago
Thu, Oct 14, 21, 20:53, 3 Years ago
Thu, Apr 28, 22, 10:16, 2 Years ago
;