Homebrew

Aliases
  • brew
Image of Author
June 23, 2023 (last updated September 21, 2024)

https://brew.sh/

Homebrew, aka brew, is a MacOS CLI tool that describes itself as

The Missing Package Manager for macOS (or Linux)

This is essentially a true statement! I use it for managing most tools and apps I use. The major exception is programming languages, which in general requires multiple version management, and for which I use asdf. I talk about this more in my note on Homebrew and asdf.

Dependent formula discovery

You can discover dependent formula of a formula by running

brew uses --installed [formula]

--installed means only check formulae that are currently installed.

Keg-only

Keg-only means the package was installed on the machine, in "Cellar", but that it is likely not discoverable.

Sometimes formula replace system executables, or otherwise would cause conflicts if installed in "normal locations" or included on the PATH. Other times, it is merely open-ended what should occur to a package post-installation, and it therefore is up to the user to decide on next steps.

Usually, the "caveats" section of a package description will recommend steps after installation. You can access these any time via,

brew info [formula-name]

For example, I installed libpg on my macos, but there is a system

For example, it is common to install via brew newer versions of system packages. It could potential cause hard to debug problems to have brew override the system defaults. Instead, it is common for brew to make the formula "keg only" and then in the formula "caveats" section, it will inform you to add it's location to the front of PATH, so it is found before the system version when you make CLI calls, etc.