Rule of thumb, at least on Debian-flavoured systems:
/usr/localfor stuff which is “system-wide”—i.e.
/usr/localtends to be in a distro’s default
$PATH, and follows a standard UNIX directory hierarchy with
/optfor stuff you don’t trust to make system-wide, with per-app prefixes—i.e.
/opt/mono-2.6.7, and so on. Stuff in here requires more careful management, but is also less likely to break your system—and is easier to remove since you just delete the folder and it’s gone.
If you really don’t want it to interfere at all, don’t put it anywhere in your
If you want it in
$PATH, at least make sure not to install to
/usr/local. I’ve found that a lot of software looks there even if it’s installed by the distro into
My favorite way to install custom-compiled software is in my
$HOME directory. That way you don’t have to use
sudo for anything, and it’s very nicely separated from the rest of your system. For example:
mkdir ~/stage ./configure --prefix=/home/username/stage && make && make install
And if you want to, you can then add
/home/username/stage/bin to your
FHS says to put it in /usr/local where distributions shouldn’t be touching it.
/usr/local/bin for the binaries
/usr/local/src for the source and
/usr/local/lib for libraries. See the FHS spec for more info