12

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.

2
  • Even better... unix.stackexchange.com
    – mxmissile
    Oct 29, 2010 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, 2010 at 19:53

6 Answers 6

15

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.

3
  • ... and which should not be written to because their content is managed by package management. Nov 1, 2010 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). Nov 1, 2010 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. Apr 2, 2011 at 23:06
4

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.

2

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

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

Option number 3:

./configure

make

sudo make install
2

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.

2

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .