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?
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.
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.