MacOS – “Reinstalling” /usr and /local folder

macos

How would I be able to reinstall Yosemite keeping the software I've installed through things like brew or macports but not the "system" files? For example, the system files being /System, /usr, /bin, /Library and such.

I think that I might have to backup my personal files then do a full system wipe and then move everything back over. Is there an easier way?

Best Answer

When you upgrade OS X the installer preserves the things that you've installed to /usr/local (through Homebrew) and /opt (through MacPorts). Always a good idea to have backups though, just in case.

It has been suggested that you might want to temporarily move the contents of /usr/local to speed up the install though. Faster Mac OS X 10.10 Yosemite Upgrades for Developers