Friday, January 03, 2014

What is the best place to install user apps?

According to Linux Filesystem Hierarchy Standard, "/usr/local" indicate:

The original idea behind '/usr/local' was to have a separate ('local') '/usr' directory on every machine besides '/usr', which might be just mounted read-only from somewhere else. It copies the structure of '/usr'. These days, '/usr/local' is widely regarded as a good place in which to keep self-compiled or third-party programs. The /usr/local hierarchy is for use by the system administrator when installing software locally. It needs to be safe from being overwritten when the system software is updated. It may be used for programs and data that are shareable amongst a group of hosts, but not found in /usr. Locally installed software must be placed within /usr/local rather than /usr unless it is being installed to replace or upgrade software in /usr.

So if you have a software that requires compile installation, put it in /usr/local, never install programs in /usr/, it is likely to cause chaos, things installed in /usr/ is meant to be for distribution packages only (usr stands for Unix System Resources). If you just need to extract a tarball and run directly (e.g. Thunderbird, Firefox) then put it into /opt/. /opt/ should be used for installation of pre-compiled (binary) packages (Thunderbird, Eclipse, Netbeans, IBM NetSphere, etc) and the like. But if they are only for a single user they should be put in your home directory.

No comments: