Install (almost) any free Mac app by typing four words and hitting “Enter”. With Homebrew for Mac you can install thousands of programs with just a few keystrokes, and update them all with just a few more.
If you’ve spent any time looking into cool things to do with the Mac Terminal, you know that your Mac is missing a bunch of the commands many Linux distros come with out-of-the-box: WGet, for example. If you’ve tried to download and install these commands, you know that it can get… complicated. Your options are to find a binary that may or may not be sketchy (risky), or to compile the code from source yourself (potentially time-consuming).
Happily, there’s a better way. With Homebrew you can install any command utility in just a few keystrokes. Add Cask to your Homebrew and you can also install desktop apps, like Firefox and The GIMP, just as quickly. And updating everything is easy too.
Linux users know all about this: package managers like apt-get and yum are powerful tools for installing software quickly. Homebrew brings this power to your Mac; here’s how to use it.
Installing Software With Homebrew
So how does Homebrew work? Here’s an example: the command for installing WGet.
brew install wget
You should never run a Terminal command you don’t understand, so here’s a quick breakdown.
- “brew” is the command for Homebrew.
- “install” tells Homebrew that you want to install a program
- “wget” is the name of the package you want to install.
Run the command and Homebrew will download, and then install, the program you’ve requested. The progress bar is kind of fun:
You don’t need to do anything else here: when the installation is done, you can start using WGet immediately. Easy, right? You can read our old article about installing WGet on your Mac if you want an idea of how long this process can take without HomeBrew.
There are an awful lot of packages offered by Homebrew – thousands. You can use the “search” command to find exact names. For example:
brew search elinks
This command tells Homebrew to “search” for packages called “elinks” (a Terminal-based browser). You’ll get a list of all matching packages, letting you know the precise name of the package you want. Alternatively, you can head to brewformulas.org – you can search for packages there and find the complete command for installing them.
There are more tricks you can do with Homebrew. For example:
This one, as you might guess, will update Homebrew’s package list. You can then upgrade every package you’ve installed using this command:
This is an easy way to keep your tools and software up-to-date, but note that it only works with software you’ve installed using HomeBrew. Read the Homebrew Wiki for more information.
Installing Homebrew On Your Mac
Are you ready to get started using Homebrew? Head to the official Homebrew website and you’ll find a command to run – I won’t paste it here in case it changes. The command downloads a script and runs it, installing Homewbrew. You’ll probably need to install the Command Line Tools for your Mac during this process.
In the past I’ve run into hiccups with this – the automated download from OS X didn’t work, and I needed to install XCode. As of this writing, in 10.10 Yosemite, the Command Line Packages install from the above prompt without issue on a machine without XCode installed.
If everything goes well Homebrew should install in just a few minutes. If it doesn’t, first install xcode then try again.
Cask Install Mac Applications From The Command Line
Homebrew, on its own, is mostly for installing command line tools – not desktop Mac apps. You can change that, easily, by installing Homebrew Cask. With this, you might never need to “drag an icon” to install ever again. Here’s how to install:
brew install caskroom/cask/brew-cask
Once it’s installed, you have access to 2000+ Mac apps. The command for installing this software is a word longer:
brew cask install gimp
As you can see, I need to specify that the program I’m installing is from Cask to Homebrew knows where to look. Once I enter the command, everything is hands-off: the program will download and install.
A lot of the best Mac apps out there are supported in spectacular lower-case command line fashion, including:
You can use the Homebrew “search” command to find apps, as I explained before, or you can use the search bar at the bottom of the Homebrew Cask homepage.
Commands You Should Install With Homebrew
Wondering what you can do with your new powers? Here are a few Terminal programs worth installing with Homebrew:
brew install pianobarinstalls one of the best Pandora players for your Mac. You can log in to Pandora and start listening to your stations, all from the Terminal.
brew install ttytterinstalls an app for using Twitter from the command line.
You can also find amazing Terminal commands at CommandLineFu. I’m sure there are a lot more awesome utilities out there for general users; please share any you know about in the comments below.
Oh, and Windows users: you’ve not left out here. A free program called Chocolately lets you install Windows software from the command prompt, so check that out if this ability interests you.
What have you installed using Homebrew recently?