← Blog

Post

Brew: Package manager for macOS

Over the last few days, I’ve reinstalled my computer following some ideas I’ve had, and I’ve also wanted to explore the topic of package managers in more depth on macOS. So, over the next few days, you can expect a series of articles here on the subject of brew.sh.

What is brew.sh?

A package manager, similar to apt on Debian systems. Put simply, it’s a sort of App Store, but with multiple repositories, update mechanisms and, of course, running in the shell.

Why does this make sense?

We use lots of programmes on the Mac. Some are from the Mac App Store, but others are downloaded from the internet, such as Google Chrome, Spotify and so on. It makes sense to get, install, uninstall and update all these programmes from a single place (other than the Mac App Store).

When you delete apps, you’ve probably learnt to simply drag them to the Trash; then they’re gone. That’s the right way to do it, but loads of cache files and other items remain on your Mac that you no longer need either. There are tools available to find and clean these up, such as CleanMyMac or AppCleaner.

When using brew, this content is also removed completely, as the package installation process logs where data is stored.

The installation

  • Open the website https://brew.sh
  • Copy the following command (it may be more up to date on the website itself, but it hasn’t been wrong in recent years):
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
  • Paste this command into your Terminal. You will be asked for your password.

During installation, the Xcode Command Line Tools will be downloaded; you may receive a notification about available updates in System Preferences. Simply ignore these and let the process run to completion in Terminal.

After installation

Please take a moment to consider whether you are happy for anonymised statistics about your usage behaviour to be shared with the authors of brew.sh. You can find a bit more information here.

If you don’t like that, you can disable the collection of statistics using this command. Of course, you’ll need to enter it in your terminal as well:

brew analytics off

Install the first package

We’ve taken the first steps, and now it’s time to get down to business. Which package would you like to install? Personally, I use a web browser most of the time; I’ve installed Safari (which comes pre-installed), Google Chrome and Mozilla Firefox. I’ll show you how to do that in the next article.

Brew: Installing packages (example: Mozilla Firefox)