Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I often find build instructions like this:

./configure
make
make install

while in reality I need to type

sudo make install

Why is this not mentioned in the installation instructions? Or is it supposed to be such common knowledge that it isn't worth mentioning? Or are you assumed to be logged in as root?

share|improve this question
add comment

5 Answers 5

up vote 10 down vote accepted

They give you the correct commands, it is up to you as a user to ensure you have the correct privileges.

share|improve this answer
    
That makes a lot of sense. Thanks! –  StackedCrooked Nov 21 '09 at 23:41
2  
A lot of build instructions are very generic, they can build on many different platforms, some of which don't even have sudo. Sudo also isn't really a command related to the build, just a security measure. –  prestomation Nov 22 '09 at 0:58
add comment

"sudo" may not be required if, for example, you have already run "su" and your session is running in elevated permissions. That negates the need to run sudo. Generally the use of sudo is preferred, but it is not strictly the only way to reach the same goal.

share|improve this answer
4  
sudo also isn't always available/installed. –  innaM Nov 20 '09 at 21:27
    
You should add that as an additional answer, @Manni, since comments don't earn rep. :) –  JMD Nov 20 '09 at 21:31
    
You might also set --prefix to be $HOME/bin –  Nerdling Nov 20 '09 at 22:12
3  
@nerdling: don't do that. set --prefix to $HOME. by default the bindirectory is $prefix/bin. you could set --bindir to $HOME/bin directly, but that won't change the installation directory for files destined for $prefix/share, $prefix/lib, $prefix/man, $prefix/sbin, etc. –  quack quixote Nov 20 '09 at 23:29
add comment

You may not actually need root permissions to install a given software package, or you may not have access to root privileges via sudo or su or other methods.

One of the ./configure script's common options is --prefix, which changes the base installation directory from whatever the default is. So on a system where I have no root privs at all, I can still install this software to my own home directory:

./configure --prefix=$HOME
make
make install

The ./configure script has lots of other options, some common to all, some dependent on the particular package you're compiling. Use ./configure --help to see them all.

share|improve this answer
2  
This answer, plus: it's not standard to make you use sudo for all your admin work. It's only some distributions (typically recent ones such as Ubuntu) that take this approach. –  bobince Nov 21 '09 at 3:18
add comment

sudo is only available in certain distributions. In others, you must use su to switch to the root user, the run the command. They are NOT assuming you are already logged in as root, since you should never just be running things as root. They are assuming that you know enough about your system to know how to run something as root. It is quite common to need to run installations as root, so do be used to how to do it on your system.

share|improve this answer
add comment

Perhaps your instructors looked like this. I've seen the following many times:

$ ./configure
$ make
# make install

Notice the hash/pound sign. On almost every Linux distro I've used, this sign indicates you're in a root shell.

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.