As a developer, we always are in the need to install libraries to compile our code, or as dependencies of some other software that we use. Take as example a PHP extension (if you use the version shipped with OS X): you will have to download the source code for it, phpize it, and then configure and install the extension. Or maybe, you come from the Linux world and (like me) like to spend a lot of time and feel more productive in the Terminal, you’ll notice how difficult it is to have elementary packages running, like wget or htop.
Homebrew is the easiest way to accomplish those cases above, and even more! It isn’t the only option out there (MacPorts and Fink are its competitors) but it is definitively the most popular one.
First of all, you will have to install Xcode app, which is the IDE to develop Apple software for Apple devices.
Once it is downloaded, you need to open Xcode to agree with the licence and after that, it will install final components.
After this, you have to install the Command Line Tools (it gives terminal users many commonly used tools, utilities, and compilers, including make, GCC, git, libtool, cpp, what, and many other useful commands that are usually found in default Linux installations):
Once the dependencies are covered, you can install Homebrew:
and that’s it! In a single command you are giving such power to your terminal. Before install any package with, it is better to check that everything is set up for Homebrew, and for that you can use this command:
After this, you’re ready to go. For example, to install wget package,what you only need to do will be:
and once it finish, you will be able to download resources using wget command.
You can search for packages to install with the command
List the ones there are installed in your OS X with
And, as any other package manager, you can keep your installed packages up to date with
Or, for a specific package with
With those basic commands, you are good to go, but if you want to go deeper with this tool, you type
To check everything Homebrew has to offer, and of course, there’s its website where you can find the online documentation.