Installing a package into a user other than root
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 battles,
Software installation must be done under root privileges for security reasons. There're a few ways to do it, being the most common: Code:
sudo apt-get install boa Regards, Eudald |
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. :)
|
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. |
Told this was a no no
Quote:
|
You do have to be as careful with sudo it's just temporary root for the most part.
|
Key creation problem
I think my Key creation problem was kind of unique. I was just using sudo on everything I was doing.
|
Slightly off topic, have you done:I see the 7.1 and I'm at 7.4?
|
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.
|
If you don't do updates or automate at least security ones you won't have them...
|
Same thing with personal and config data backups. ;)
|
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. |
All times are GMT -5. The time now is 12:46 AM. |