Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm setting up a new server running Ubuntu Server Edition, and I'm not certain what the difference would be between installing most of the basic software as root, vs installing the basic software as an admin user using sudo apt-get install .

For one thing, I'm not sure whether after installing the software as root, I'll need sudo access when running the software as a user (e.g. if I install git as root). On the other hand, if I install software as a user, I could conceive of it not being available to other users that I create in the future.

What's the best practice here?

share|improve this question
add comment

2 Answers 2

up vote 4 down vote accepted

It depends on how you are installing. If you are using sudo to call apt/dpkg to install things it shouldn't make any difference either way. APT/DPKG does everything it needs to do to set things up correctly.

If you are compiling things on your own there is a remote possibility that some of the environment settings from your user account will direct how the application is being installed. For example your when using sudo your $HOME will still be point at the home directory of your unprivileged account. If the compilation/installation depends on $HOME at all, then things could get messed up. It is not common for compile/build scripts to have problems though, I have only seen this issue on one very obscure package.

share|improve this answer
    
Good to know, thanks. –  Kzqai Mar 12 '10 at 19:24
1  
BTW, if you want to have sudo change your home directory to the target user's, you can also use sudo -H. –  Chris Lercher Mar 12 '10 at 21:16
add comment

Just to add to what Zoredache has said.

One hang up I've run into with sudo is using it to build kernel modules from source with make install command. The build itself works but it can't install the module for some reason. Either it's dropping privileges in the make script sometime or it's an environment issue.

But using apt/dpkg and related utilities shouldn't matter. Sudo when used with apt/dpkg or any other sys admin activities does help log the actions so that's one reason to use sudo.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.