The easiest way to install various Unix tools and open source software onto OS X is via a package manager or repository, unfortunately OS X doesn’t come with one, but fortunately there are some good folks that care. They come in the form of Homebrew.
Compatible in OSX 10.8 Mountain Lion…
Get Xcode 4.6 from the Apple app store, free download version, then install it and launch it from the /Applications folder. Go to Xcode preferences and then look in the ‘Downloads’ button.
Install the command line tools from the preferences of Xcode.
To download install Homebrew run the install script on the command line as below and let the script do its thing:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Download and install XQuartz brew will moan as it is no longer installed as part of 10.8 and Xcode
After installing and as suggested in the command line, to check for any issues with the install run:
If upgrading from a previous OSX version, update Xcode location
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
To search for an application:
brew install <application-name>
To list all apps installed by Homebrew
To remove an installed application
brew remove <application-name>
To update Homebrew
To see what else you can do
Where does Homebrew install stuff …. in the Cellar
Where the brew lives.