Difference between “make install” and “sudo make install”

makesoftware installationsudo

Sometimes I encounter problems with using make install which gives me a permission denied error when writing to some folders. So instinctively I use sudo make install. Will this introduce additional problems?

I am using Debian Etch.

Best Answer

Avoid making local installs into system directories. The system directories eg /usr, are reserved for the package management system to use. By definition, if you are doing make install that means you are making a local install, and if you need to do sudo make install that means you don't have permission to wherever you are writing.

So, if you are getting permission errors with make install, check and see whether you are trying to install into system directories, and install into /usr/local or similar instead. /usr/local is reserved for local installations. You may need to give yourself permission to write to /usr/local, but this is usually easily done. On Debian this can be done by adding yourself to the staff group. Better still, find or create a binary package, and install that instead. That way you can easily keep track of installed packages and obtain the other benefits of package management.

Note that the package management system conversely does not install into /usr/local, per the FHS. See Section 9.1 of the Debian Policy Manual- File system hierarchy for an overview.