September 23, 2026

The mac mini -- installing brew

I just installed Haskell, so I have the Xcode command line tools.

Brew (aka "homebrew") is a package system for open source software on macOS. You could use it on linux also, but typical linux systems already have a perfectly good package system.

  • Homebrew home page
  • I was going to use brew to fetch "git", but that is already supplied by Apple as part of the command line tools in:
    /Library/Developer/CommandLineTools/usr/bin
    
    This directory has a huge arsenal of tools, including make, git, ctags, pip3 for python. It even has the swift language (indeed, I can type swift on the command line).

    cc, gcc, and clang all seem to be the same.

    Installing brew

    I run the recommended command:
    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    
    It tells me it will but stuff in /opt/homebrew. In particular /opt/homebrew/bin/brew is the brew command itself. It uses the git command in the developer tools collection When done, it advises:
    Run these commands in your terminal to add Homebrew to your PATH:
    echo >> /Users/tom/.bash_profile
        echo 'eval "$(/opt/homebrew/bin/brew shellenv bash)"' >> /Users/tom/.bash_profile
        eval "$(/opt/homebrew/bin/brew shellenv bash)"
    
    - Run brew help to get started
    - Further documentation:
        https://docs.brew.sh
    
    I type:
    brew help
    brew doctor
    Your system is ready to brew.
    
    So this looks good. At some point I want a real gcc that supports compiling for the variety of small ARM microcontrollers I work with.

    Using brew

    Usually "brew install xyz" does what I wants.

    Using "brew search xyz" is very useful. Brew list shows installed packages.

    Brew has formulae and casks. The usual (normal?) thing is a formulae, which seems to be transparent. A cask allows GUI applications, packages that include libraries, and other messy things. Apple has a thing called "Gatekeeper" which enforces certain rules. Note that you use "brew install --cask" in such cases. This all seems foggy and confusing to me.


    Have any comments? Questions? Drop me a line!