FHS and Locally Compiled Software

According to FHS*, a sysadmin would put custom scripts or anything they compile locally in/usr/local/bin and /usr/local/sbin, while pre-compiled, 3rd party applications go in /opt.

This makes sense to me, but in my experience, software usually wil make install to a new folder in /usr/local/ and create a new set of bin, sbin, etc, var and whatever else in that folder.

For example, Samba does this if you install it from source, although you can set various flags during compilation to enforce FHS.

Ex: --enable-fhs --prefix=/usr/local --localstatedir=/var

By default, Samba’s make install will put everything into /usr/local/samba. These flags will tell it to install to /usr/local/ and /var.

I see several pros and cons to either approach:

Installation to /usr/local/somefolder


  • Isolation – all of the compiled software is contained and can easily be removed, upgraded, backed up, etc
  • Easier to follow documentation/troubleshoot with default install – most other people are probably doing it this way
  • Path of least resistance


  • Not compliant with FHS
  • Requires manual configuration of selinux
  • Doesn’t take advantage of OS partitioning (if /var is on a separate partition for example)
  • Requires additional entries in PATH

FHS Installation


  • Selinux-friendly
  • OS partitions are used
  • Warm fuzzy feeling of being FHS compliant
  • No changes to PATH needed (well, sometimes you have to add /usr/local/bin, but that’s it)


  • All locally compiled software shares the same bin, sbin, etc and var, so removing, updating, backing up a single piece of software is more complicated.
  • Slightly more admin overhead for troubleshooting

So I just want to see how other people deal with this, or maybe just start a discussion on best practices. I am leaning toward using FHS, at least when the software gives me the option to do so, but I also split my server installations across several partitions and am generally obsessive compulsive about keeping things up to spec…

I would be especially interested to hear from anyone who uses Slackware, Gentoo or any other distro that relies heavily on locally compiled software.

* The actual FHS spec should be here, but it seems to be down ATM.