Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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

share|improve this question

2 Answers 2

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.

share|improve this answer

The FHS is a Linux standard (which not all distributions follow, and which is hopelessly outdated in the GUI area at least). It is mostly codification of existing practice, as standards are prone to be. As such, you will find that other Unixy systems (BSD, Mac OS, the propietary Unices, Minix 3, ...) use similar conventions. The /usr/local hierarchy is very old, initially it used to hold locally developed software, then with propietary Unix it became customary to install non-vendor software there (including stuff downloaded from Usenet) to keep it apart, not interferring with system updates. The GNU project popularized this use, and codified it in its installation scripts as a default (GNU was the source for decent tools for Unix up to the '90ies; particularly irritating were typically braidead vendor compilers and develoment tools in general, bad/outdated versions of vi, and a dumb shell. Jokingly it was said that the first thing to do with a new e.g. Sun was GNU > /usr/local.).

<curmudgeon> 
   These kids today don't know the luxury of up to date, working
   tools they have at their fingertips, running on personal machines
   that would have been supercomputers in our day. For free.
</curmudegon>
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.