Generally speaking, should self installation by compiling source be stored in /usr or /usr/local (specified to --prefix)?

When to install to /usr and when to /usr/local?


  1. I often run checkinstall to create a deb file after compilation of source distribution, and checkinstall installs the software by calling dpkg. isn't this the same as installing software from OS repositories? After install, both can be managed by dpkg. What differences are between them?
  2. I am running Ubuntu 14.04. I don't use emacs from its repository.

    I installed my emacs by compling from source and checkinstall, the default location is /usr/local. e.g. /usr/local/bin/emacsand /usr/local/share/emacs/24.4/.

    I installed ESS from its offical site. The default install location is /usr e.g. /usr/share/emacs/. I don't find a way to specify --prefix for ESS. I run make install directly.

    So in my emacs, I can't find S mode offered by ESS.

    Shall I reinstall emacs with ./configure --prefix=/usr?



You should place locally-installed software in /usr/local.

I have no idea what ESS is but I downloaded the file you mentioned and it looks like you could change its install location by editing Makeconf in its root directory and changing PREFIX=$(DESTDIR) to PREFIX=/usr/local.

| improve this answer | |
  • thanks. why not --prefix=/usr? – Tim Apr 22 '15 at 22:40
  • @Tim, This is a common best practice to avoid conflicts with you OS own packages. – Rabin Apr 22 '15 at 22:42
  • Do you mean why isn't the syntax --prefix=/usr for that specific software, or do you mean why is it not a good idea to install locally in /usr? The former: because that particular software doesn't have a configure script that takes that option. The latter: @Rabin already answered that. – Celada Apr 22 '15 at 22:43
  • Thanks. The latter. ESS install things to /usr/share/emacs/ by default, Do you think it is a bad location? ("conflicts with you OS own packages"?) Do you think changing to /usr/local is better than the default? – Tim Apr 22 '15 at 23:20
  • Yes, I think /usr/local is better than the default and I think that the developers should have published it with /usr/local as the default. Operating system packagers such as Debian maintainers then have the burden of overriding it to use /usr for the OS package only. – Celada Apr 22 '15 at 23:30

Not the answer you're looking for? Browse other questions tagged or ask your own question.