I'm installing IntelliJ, and the readme tells me to choose an installation folder. Where is a good, standard place to put installed programs?
If you are the only user of it, just slap it in
/home. If not,
/usr, which should only be used by distro-managed software. Many source installers use
/usr/local by default, but the advantage of
/opt/intellij is that you can wipe the entire directory if you no longer have a use for it. Putting it under
/usr/local, the stuff would get distributed all over the place, adding the need to track where those are installed; there's tools for that, but don't bother. Any decent installer should create all directory structures for your installation to work, wherever you choose to install to.
(adapted from my answer to an earlier, similar question about packages installed from source)
If you start having many programs installed outside your distribution, you'll start running into package management issues: what version of foo have I installed? What files belong to foo, so that I can remove it (if you have foo mixed with other packages)? I'm tired of adding yet another directory to my
PATH (if you have foo in a directory of its own). So I recommend using some form of package management.
Stow is a poor-man's package manager. The principle is to store each package in its own directory but maintain symlinks in standard directories.
- Install under
~/usr/stow/PACKAGE-VERSIONor wherever). (
VERSIONrepresent the name and version of the package. These names are for your convenience only.)
- If you picked a directory other than
~/usr/bin(or wherever) to your
stow PACKAGE-VERSIONfrom the
/usr/local/stow(or …) directory. This creates symbolic links in the “normal” directories, e.g.
/usr/local/bin/foo-command -> ../../stow/foo-4.2/bin/foo-command.
- If you ever want to uninstall this program, just run
stow -D PACKAGE-VERSIONto remove the symbolic links, and delete
There is also xstow which is a similar, but more powerful programs (one of its benefits is that it can deal with conflicts).