Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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.
@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
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
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.