Linux – FHS differences between OS X, Linux and FreeBSD

fhsfilesystemsfreebsdlinuxosx

I've read that there is a different behavior between FreeBSD and Linux with the /usr/local, in FBSD ports are installed there, in Linux not, can someone explain more on this?
I'd like to know where MacPorts are installed in OSX, and a list of the most significant differences between the FHS of those three OS (this is mainly what I'm looking for).

I've already made a research but I didn't find really much.

https://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man7/hier.7.html

http://www.freebsd.org/doc/handbook/dirstructure.html

http://www.tldp.org/LDP/Linux-Filesystem-Hierarchy/html/index.html

Best Answer

You can find the Filesystem Hierarchy Standard (FHS) version 2.3 at pathname.com/fhs. There is a section about the usr hierarchy. The FHS lists /usr/local as a required directory and writes:

local Local hierarchy (empty after main installation)

Furthermore FHS writes:

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.

The different Linux distributions usually don't write software to /usr/local. Instead each file is placed into the filesystem according to the FHS.

If you install software from source (./configure && make && make install) without specific options this software copies itself usually to /usr/local.

The default directory for MacPorts is /opt/local. The MacPorts guide has a description of the internals.

Related Question