Homebrew
The missing package manager for macOS
Last updated
Was this helpful?
The missing package manager for macOS
Last updated
Was this helpful?
A package manager or package management system is a collection of software tools that automates the process of installing, upgrading, configuring, and removing computer programs for a computer's operating system in a consistent manner.
This is where we’ll be installing software packages like Git, Node.js, or Python. We can also install GUI apps such as Google Chrome, Slack, or VSCode.
Why do you need this? Homebrew works great for managing for automating the process of installing, upgrading, configuring software packages that you can't normally install using the App Store.
An important dependency before Homebrew can run is the Command Line Tools for Xcode, so make sure you’ve completed the previous step. These tools include compilers that allow you to build software from source. If you’re missing this, it’s available through App Store > Updates.
To install Homebrew, paste the following command into your Terminal, press Enter, and follow the on-screen instructions::
You might need to add Homebrew to your PATH.
You can do so by entering these two commands:
To start using Homebrew, you’ll need to open a new Terminal session. Do this by opening a new Terminal tab with Cmd+T (be sure to close the old one). Then, run the following command to ensure everything is working correctly:
After that, let's choose a terminal in the next section!
To install a package (or Formula in Homebrew vocabulary) simply type:
After installing, give it a try!
To update Homebrew's directory of formulae, run:
Note: I've seen that command fail sometimes because of a bug. If that ever happens, run the following (when you have Git installed):
To see if any of your packages need to be updated:
To update a package:
Homebrew keeps older versions of packages installed, in case you want to roll back. That rarely is necessary, so you can do some cleanup to get rid of those old versions:
To see what you have installed (with their version numbers):
Install the package which displays directories as trees in the terminal