LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Problem in installing jdk (https://www.linuxquestions.org/questions/linux-newbie-8/problem-in-installing-jdk-920515/)

DxTer 12-25-2011 11:38 PM

Problem in installing jdk
 
I have tried many solutions given over the internet but still getting this error.

$ apt-get install sun-java6-jdk sun-java6-jre
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?

klearview 12-25-2011 11:42 PM

sudo apt-get install sun-java6-jdk sun-java6-jre

DxTer 12-25-2011 11:44 PM

again same problem!

dudeman41465 12-25-2011 11:50 PM

Just make sure of two things.

1) You're running the command as root or with sudo.
2) You don't have any other package management software open such as synaptic or the software center. Only one instance of apt/aptitude can run at a time, and synaptic locks it just by being open. The software center will lock it if it's installing something.

DxTer 12-25-2011 11:55 PM

@dudeman41465
I did run the command using sudo and also restarted my system quite a bit time so I guess there are no other packages of synaptic or software center running? right?

dudeman41465 12-26-2011 12:18 AM

Quote:

Originally Posted by DxTer (Post 4558358)
@dudeman41465
I did run the command using sudo and also restarted my system quite a bit time so I guess there are no other packages of synaptic or software center running? right?

If you haven't opened anything, then the command above should work just fine. Occasionally it'll fail because the update daemon will be using apt to check for updates, but that usually only takes a minute or two, so if it's still saying no, then try waiting 5 minutes and try again. If it still refuses to co-operate, and since you've rebooted, it should be safe to remove the lock files. I got that idea from this mailing list thread here.
Linkage

DxTer 12-26-2011 12:24 AM

thank you, it's done!! :)

dudeman41465 12-26-2011 12:46 AM

Quote:

Originally Posted by DxTer (Post 4558371)
thank you, it's done!! :)

No problem, :-)


All times are GMT -5. The time now is 01:12 AM.