Managing packages on macOS with Homebrew

illustrations illustrations illustrations illustrations illustrations illustrations illustrations
post-thumb

Published on 14 July 2022 by Andrew Owen (2 minutes)

If you’re a Linux user, or you read my article on Scoop, you’ll be familiar with package managers. They aim to simplify installing, upgrading, configuring and removing software. A key feature is dependency management: if a package requires software that isn’t already installed, the package manager can install it.

Apple’s solution to managing installed software on macOS, and its other operating systems, is the App Store application. Typically, end-user applications don’t have dependencies. However, command line tools often do, particularly if they originated on Linux. Another issue is that macOS typically ships with older versions of common tools, if it includes them at all.

The most popular third-party package manager on macOS used to be MacPorts, and it’s still a valid choice. But it has been replaced in popularity by Homebrew, which is based on Git and Ruby.

If you haven’t already installed the Xcode command line tools, you might want to do that first. From the command line, enter: xcode-select --install.

To install Homebrew, open the Terminal and enter /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)".

To update the package list, enter brew update. To upgrade all packages, enter brew upgrade. Now you’re ready to add whatever packages you like.

Homebrew includes an extension called Cask. You install command line apps with brew install <app name>. For graphical apps use brew casks install <app name>.

Having been using an M1 (ARM CPU) Mac for over a year now, I’m pleased to report that I haven’t run into any problems with Homebrew.