[SOLVED] Installing a package into a user other than root
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 am having difficulty understanding how to install a package into a user other than root. I log into a user I have created as adduser webserver. When i go to install, I get:
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?
Do I need to do a 'sudo apt-get install boa'?
Does that install boa in root rather than user webserver?
Also can't figure what using just su does.
Thanks.
Hi. I'm no guru on this but most software gets added as root then you (may need to) add users or groups privileges to use it... hope that helps best wishes and have fun.
Last edited by jamison20000e; 04-23-2014 at 08:19 AM.
Software installation must be done under root privileges
Thanks. I suppose that it installs it into the user wherein you type 'apt-get install boa'.
The reason I was somewhat confused is because I created a key with a program using sudo before the program's name within the program's user, but the program put the key into the root folder. I was told to leave out sudo to get the program to put the key in the user's folder instead.
Hi. I'm no guru on this but most software gets added as root then you (may need to) add users or groups privileges to use it... hope that helps best wishes and have fun.
Appreciate you post. From what I have been told, you should never install anything into root, but always put installed programs into a user account. I am so new to linux, what do I know?
Interesting. My server is providing Debian 7.1. Being somewhat new to Linux, I don't want to do that, lest I blow myself up somehow . Will keep the string in my notes.
Programs get added AS root, they should not go into /root/ which is the /home/ for root. They typically go to /usr/bin/ or /usr/local/bin/ depending on the system. For the execute-able anyway. You should never RUN programs as root (if you can avoid it), and prefixing things with sudo does things with root permissions. But not all programs adhere to best practices. And many daily admin stuffs (updates) gets us into bad habits.
In general you cannot install programs as a user. At least not with the package management system. Not entirely true, you can apt-get source <package> and compile the app and run it from the /home/ of the user as the user. And maybe some cryptic way to get the deb and extract the contents to the /home/ of the user as the user. But that's not typically done, except for developer types.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.