Ubuntu – When installing user applications, where do “best practices” suggest they be located

application-developmentsoftware installation

Occasionally I install applications manually, rather than using apt or another package manager.

What location (/usr/, /usr/local/, /opt/, /home/, etc.) is suggested by "best practices" for the installation of user applications?

Best Answer

  • That depends, really. If the application has a makefile, or for example for python apps if the application uses distutils (e.g., has a setup.py file), or a similar build/install system, you should install it into /usr/local/. This is often the default behavior.

    From what I understand, /usr/local/ has a hierarchy that is similar to /usr/. However, directories like /usr/bin/ and /usr/lib/ are usually reserved for packages install via apt. So a program expecting to get "installed" into /usr/ should work fine in /usr/local/.

    If you just need to extract a tarball and run directly (e.g. Firefox) then put it into /opt/. A program that just needs one directory and will get all files/libraries relative to that directory can get one directory for itself in /opt/.