A Quick Guide to Homebrew
The best package manager for Mac
macOS has an app store. But it probably won’t contain all the software, apps, and utilities you need. Especially if you are an advanced user who requires access to plenty of tools for work, you’ll realise that macOS lacks a good package manager. And that’s where Homebrew come in.
What is Homebrew?
Homebrew, put simply, is the missing package manager for macOS (it’s their slogan after all). Homebrew installs stuff that you need that Apple didn’t or aren’t available on the Mac App Store. With a simple brew install
or brew install —-cask
. No more ‘Drag this icon into the Applications folder’.
Want to read this story later? Save it in Journal.
Installation
To install Homebrew, you would need
- Command Line Tools (CLT) for Xcode
- A Bourne-compatible shell for installation (bash or zsh)
Initial Setup
To check if you have Xcode CLT on your Mac, run this in your terminal:
xcode-select -p 1>/dev/null;echo $?
The return value will be 2 if they do NOT exist, and 0 if they do.
To get CLT for Xcode, download the Xcode app on the Mac App Store or run the following in your terminal:
xcode-select --install
To change your terminal shell, here’s a pretty helpful guide.
Now that you’re all set up, copy and paste the following into your terminal:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
Voila! You’re now ready to use brew on your Mac.
Some Tips
brew install cask
This installs brew cask
. Homebrew typically deals with command line software. brew cask
is an extension to brew
which deals with Graphical User Interface (GUI) applications. You can now use brew install --cask...
in addition to brew install...
.
Follow the following steps to update your local packages:
brew update
This updates the formulae and Homebrew itself.
brew outdated
This checks for formulae which are outdated.
brew upgrade
This upgrades all your packages.
brew upgrade [package name]
This upgrades a specific formula.
To keep your software up to date, I would recommend running brew update
and brew upgrade
regularly.
brew search [package name]
This searches for casks and formulae. To get a more comprehensive list, you can use the built in search function on Homebrew’s Home page.
brew uninstall [package name]
This uninstalls any software you have installed using brew.
brew uninstall --cask [package name]
This uninstalls any GUI applications you have installed using brew.
brew cleanup
This uninstalls old versions of a formula. (Homebrew should uninstall old versions of a formula every 30 days by default)
Have fun experimenting with Homebrew! More information can be found on their documentation.
Here’s an article you may like to check out. (Yes, all the apps can be installed with brew cask
)
📝 Save this story in Journal.
👩💻 Wake up every Sunday morning to the week’s most noteworthy stories in Tech waiting in your inbox. Read the Noteworthy in Tech newsletter.