LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 04-23-2014, 08:10 AM   #1
battles
Member
 
Registered: Apr 2014
Distribution: Debian GNU/Linux 7.5 (wheezy)
Posts: 258

Rep: Reputation: Disabled
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.
 
Old 04-23-2014, 08:15 AM   #2
eudald
LQ Newbie
 
Registered: Apr 2014
Posts: 10

Rep: Reputation: 1
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
The software will be available to all users, but some features will only be accessible through root account, depending on the software.

Regards,
Eudald
 
1 members found this post helpful.
Old 04-23-2014, 08:18 AM   #3
jamison20000e
Senior Member
 
Registered: Nov 2005
Location: ...uncanny valley... infinity\1975; (randomly born:) Milwaukee, WI, US( + travel,) Earth&Mars (I wish,) END BORDER$!◣◢┌∩┐ Fe26-E,e...
Distribution: any GPL that work on freest-HW; has been KDE, CLI, Novena-SBC but open.. http://goo.gl/NqgqJx &c ;-)
Posts: 4,888
Blog Entries: 2

Rep: Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567
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.
 
Old 04-23-2014, 08:21 AM   #4
battles
Member
 
Registered: Apr 2014
Distribution: Debian GNU/Linux 7.5 (wheezy)
Posts: 258

Original Poster
Rep: Reputation: Disabled
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.
 
Old 04-23-2014, 08:26 AM   #5
battles
Member
 
Registered: Apr 2014
Distribution: Debian GNU/Linux 7.5 (wheezy)
Posts: 258

Original Poster
Rep: Reputation: Disabled
Told this was a no no

Quote:
Originally Posted by jamison20000e View Post
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?

Last edited by battles; 04-23-2014 at 08:40 AM.
 
Old 04-23-2014, 08:43 AM   #6
jamison20000e
Senior Member
 
Registered: Nov 2005
Location: ...uncanny valley... infinity\1975; (randomly born:) Milwaukee, WI, US( + travel,) Earth&Mars (I wish,) END BORDER$!◣◢┌∩┐ Fe26-E,e...
Distribution: any GPL that work on freest-HW; has been KDE, CLI, Novena-SBC but open.. http://goo.gl/NqgqJx &c ;-)
Posts: 4,888
Blog Entries: 2

Rep: Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567
Wink

You do have to be as careful with sudo it's just temporary root for the most part.
 
Old 04-23-2014, 08:49 AM   #7
battles
Member
 
Registered: Apr 2014
Distribution: Debian GNU/Linux 7.5 (wheezy)
Posts: 258

Original Poster
Rep: Reputation: Disabled
Key creation problem

I think my Key creation problem was kind of unique. I was just using sudo on everything I was doing.
 
Old 04-23-2014, 08:50 AM   #8
jamison20000e
Senior Member
 
Registered: Nov 2005
Location: ...uncanny valley... infinity\1975; (randomly born:) Milwaukee, WI, US( + travel,) Earth&Mars (I wish,) END BORDER$!◣◢┌∩┐ Fe26-E,e...
Distribution: any GPL that work on freest-HW; has been KDE, CLI, Novena-SBC but open.. http://goo.gl/NqgqJx &c ;-)
Posts: 4,888
Blog Entries: 2

Rep: Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567
Slightly off topic, have you done:I see the 7.1 and I'm at 7.4?

Last edited by jamison20000e; 04-23-2014 at 08:52 AM.
 
Old 04-23-2014, 08:55 AM   #9
battles
Member
 
Registered: Apr 2014
Distribution: Debian GNU/Linux 7.5 (wheezy)
Posts: 258

Original Poster
Rep: Reputation: Disabled
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.
 
Old 04-23-2014, 09:05 AM   #10
jamison20000e
Senior Member
 
Registered: Nov 2005
Location: ...uncanny valley... infinity\1975; (randomly born:) Milwaukee, WI, US( + travel,) Earth&Mars (I wish,) END BORDER$!◣◢┌∩┐ Fe26-E,e...
Distribution: any GPL that work on freest-HW; has been KDE, CLI, Novena-SBC but open.. http://goo.gl/NqgqJx &c ;-)
Posts: 4,888
Blog Entries: 2

Rep: Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567
If you don't do updates or automate at least security ones you won't have them...

Last edited by jamison20000e; 04-23-2014 at 09:07 AM. Reason: _________
 
Old 04-23-2014, 09:08 AM   #11
jamison20000e
Senior Member
 
Registered: Nov 2005
Location: ...uncanny valley... infinity\1975; (randomly born:) Milwaukee, WI, US( + travel,) Earth&Mars (I wish,) END BORDER$!◣◢┌∩┐ Fe26-E,e...
Distribution: any GPL that work on freest-HW; has been KDE, CLI, Novena-SBC but open.. http://goo.gl/NqgqJx &c ;-)
Posts: 4,888
Blog Entries: 2

Rep: Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567
Same thing with personal and config data backups.

Last edited by jamison20000e; 04-23-2014 at 09:17 AM.
 
Old 04-23-2014, 09:38 AM   #12
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Installing into /home as non root user (setup.py) fakie_flip Linux - Software 2 06-26-2017 04:59 AM
[SOLVED] Installing fonts as non-root user roygbiiv Red Hat 7 08-18-2011 04:36 PM
Installing fonts as non-root user roygbiiv Linux - Newbie 2 08-17-2011 05:48 PM
installing an rpm as a non-root user sidra Red Hat 2 09-19-2007 02:54 PM
can i install rpm package as non-root user? parv Linux - Software 10 09-17-2004 10:46 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:21 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration