Is it safe to delete /usr/local for a clean reinstall of misc stuff on OSX?

Or rather, was it safe? I mean... I probably should have asked before actually doing so... :-P

My understanding was that on FreeBSD systems, system stuff goes in /usr, while userland stuff goes into /usr/local.

The Mac still boots just fine and seems happy, but I'm getting excruciating difficulties reinstalling things using homebrew in the aftermath... hence my wondering... Was it actually safe, or am I heading for a complete OSX reinstall?


It's completely safe. The /usr/local directory does not even exist on a clean Mac OSX install.


If you have installed TrueCrypt, it might stop working if you remove files for MacFUSE in /usr/local/. See https://github.com/mxcl/homebrew/issues/14430.

easy_install, pip, and many installers also use /usr/local/. This lists non-Homebrew stuff in /usr/local/bin/:

find /usr/local/bin ! -lname '../Cellar/*' -ls

https://github.com/mxcl/homebrew/wiki/FAQ:

How do I uninstall Homebrew?

If you installed to /usr/local then you can use the script in this gist to uninstall — it will only remove Homebrew and the stuff Homebrew installed leaving anything else in /usr/local alone.

Provided you haven’t put anything else in Homebrew’s prefix (brew --prefix), you can generally just rm -rf that directory. This is because Homebrew won’t touch files outside its prefix.