Homebrew - Package Management for MacOS
MacOS surprisingly doesn't have a native package manager to install and manage common software packages such as wget
, telnet
, and sqlite
to name a few.
Here is what other distros have:
- Debian-base distributions for instance would have
apt (advanced package tool)
out of the box - Red Hat-based distributions such as Fedora and CentOS would have
yum / dnf
out of the box
A package manager is a software tool that can simplify a developers life by handling the nitty gritty process of managing and automating the flow of installing, upgrading, configuring, and cleaning up essential software packages.
It still surprises me to this day that MacOS does not have a built in native package manager. Open source has come to the rescue as per usual to step in for this clear gap.
Problem
There are many ways to download and install software packages. You can directly download the binary, modify ownership and executable permissions, and mv
this asset to a location defined in $PATH
to easily leverage the tool via the CLI.
However, isnt that tedious? I have to find a trusted vendor, determine the correct version to install for my needs, make sure it works in my environment (x86
, arm64
?) and then on top of that, also determine if I am on the latest and greatest version and have some sort of way to upgrade / cleanup when necessary.
Solution
Homebrew
has been available for many years now to solve these issues as the leading open source package manager for MacOS. There is also another tool called Homebrew Cask
to be able to install macOS applications, fonts, plugins, etc. without having to download a pkg
file and go through the dragging and dropping of the icon!
An example of a cask I use regularly is google-cloud-sdk
which is a bundling of all of the necessary tools / utilities to interact with GCP API's via the CLI. It would contain artifacts such as the gcloud
cli, the google-cloud-sdk
itself, gsutil
, and docker credential helpers to name a few.
Simply check out brew.sh to install homebrew
and to see a list of all of the packages you would like to manage.
You can even create your own custom tap
to add a repository to the list of formulae that Homebrew tracks, updates, and installs from. It is essentially just a simple ruby file that you can define that inherits from Formula
.
Here's an example of how to go about that: Custom Tap
Nifty Auto Update Feature
After using homebrew
for some time, I was constantly manually updating all of my packages and then going through a cleanup via brew upgrade && brew cleanup
. It finally hit me one day that there must be a way to tell homebrew
to automically do this for me.
Yep, there is! Homebrew AutoUpdate
You can simply invoke the following command:
brew autoupdate start 43200 --upgrade --cleanup --enable-notification
which will brew update
at set intervals while also invoking a brew upgrade
and brew cleanup
. This uses launchd
under the hood while also providing notifications when it's run. I provided 43200
to signify an update every 12 hours while it defaults to every hour.
Here's my current list of formula's and casks that I have been using:

Hope this helps anyone in need of a MacOS package manager and being able to invoke auto updates under the hood!