Homebrew is “The missing package manager for OS X”. It’s a great tool that I use all the time. If you’re not using it already you might be surprised by the variety of packages (Homebrew calls them bottles) that you can install. I’ve installed databases, programming languages, and many other tools using Homebrew.
Please note that you will need to have the Ruby programmming language installed first for this to work. Apple computers come pre-installed with Ruby but if you have a Windows or Linux system you may need to install Ruby first.
When I get a new computer one of the first things that I do is install Homebrew. I pop open my terminal (or iTerm) and run this:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Installing a package (bottle)
Once Homebrew is installed I start installing all the other packages I use regularly. I always need git so I install it like so:
brew install git
This will quickly install git on my system. It’s that easy. If there’s something I want to install but I don’t know if I can get it through Homebrew, I can just do a simple search:
brew search mysql
A quick search on my system reveals this:
If didn’t already have mysql, I could simply run the following command to install it:
brew install mysql
Fresh brews: keeping Homebrew current
From time to time Homebrew needs to be updated to get the latest list of available packages. This is also very easy to do:
Occasionally you will run into a problem installing a package but the issues can almost always be resolved by simply running:
This will provide detailed suggestions and commands to get you through the problem you’re encountering.
What do I have installed?
I can easily see which packages I have installed by running:
Here’s what I see on my system when I run the command:
If you’re not already using Homebrew, I strongly recommend it. You can get started at the Homebrew website.