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 am logged in as a regular user. Should I use:

./configure && make && make install

or

sudo ./configure && sudo make && sudo make install

or

./configure && make && sudo make install

when installing packages.

And could someone explain the differences.

I want all users to be able to use it.

share|improve this question

migrated from stackoverflow.com Oct 30 '10 at 0:11

This question came from our site for professional and enthusiast programmers.

    
Even better... unix.stackexchange.com –  mxmissile Oct 29 '10 at 18:31
1  
You should install software from ubuntu repositories or PPAs. If you've run into something that is not packaged yet, feel free to consider starting your own PPA. This way you will keep your system clean, will provide packages for other people too and as free bonus will eventually get more testers. –  vtest Oct 31 '10 at 19:53

7 Answers 7

The last one.

Since confiugre and make build everything in your local directory which should be readbale/writable by you.

make install is which tries to copy files to system directories. Only for this step su rights are needed.

share|improve this answer

Instead of sudo make install you should use sudo checkinstall

This way, the installed program is recognized by the package management and you can remove it again, should you no longer need it.

https://help.ubuntu.com/community/CheckInstall

share|improve this answer

You should use the least privileges that work. That's usually:

./configure && make && sudo make install
share|improve this answer

Option number 3:

./configure

make

sudo make install
share|improve this answer

Your 3rd version is correct, ./configure && make && sudo make install. Make and configure can be done as a normal user since you aren't trying to write files in a system directory, make install will often try to copy the binaries to /usr/bin or /bin which requires root access to write.

share|improve this answer
    
... and which should not be written to because their content is managed by package management. –  reinierpost Nov 1 '10 at 9:04
2  
You might even go so far as to create a user local, then issue a chown -R local /usr/local and then install software using sudo local make install so you will be warned when a package writes somewhere else than underneath /usr/local (which can mess up your package management). –  reinierpost Nov 1 '10 at 9:07
    
If the package is built in accordance with the gnu coding standards, a raw 'configure && make && sudo make install' will only install in /usr/local, and not in /usr/bin or /bin. –  William Pursell Apr 2 '11 at 23:06

You need the last version:

./configure && make && sudo make install

Configure and make can happen in your local folder but you'll need root permissions to install. That command accomplishes it.

Make sure the application you're installing isn't in the package manager already. It's typically much easier to use the pre-compiled software for your system than trying to find all the dependencies to compile something.

share|improve this answer

The && are parsed by your original shell. Putting one sudo at the front only affects the configure. The last option makes the most sense, because it will configure and compile as a regular user and then install the results for everyone to use.

One caveat is that some configure scripts will detect that they are running as non-root users and create makefiles that install into $HOME or similar. In that case, you'd want to 'sudo ./configure' as well. If you run either the configure or make as root you will have the annoyance of some root-owned files in your regular-user directory.

share|improve this answer

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.