Hands-On Mac

May 8th 2020

Hands-On Mac 8

Homebrew: macOS Package Manager

Hosted by Leo Laporte
Intro to Homebrew - the MacOS package manager
New episodes are posted every Friday.
Category: Help & How To

Introducing Homebrew - the MacOS package manager

A package manager makes it easy to install and update applications on your Macintosh. There are at least nine package managers for the Macintosh. There are the old-timers, Fink and Macports, the relatively new Nix, but my favorite is Homebrew. https://brew.sh

If you saw our last two episodes, you're ready to install and use brew. Brew is a command-line utility. You'll use terminal to install it and to run its commands, even though many of the programs it can install are standard Mac GUI apps. 

Let's start by installing brew. Here's the command:

`/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"`

(Save yourself some typing by copying this command from the Brew web page and pasting it into a terminal.) 

Because may of the tools brew installs are built from source code, you'll need Apple's free Xcode installed and the Xcode command line tools. 

Now you can install any of hundreds of pre-built "formula" for virtually any UNIX tool.

[Homebrew Formulae](https://formulae.brew.sh/formula/)

using the command

`brew install <package>`

You can remove it using the uninstall command

`brew uninstall <package>`

The command

`brew doctor`

Verifies that brew is properly installed and working. 

One of the benefits of brew is that it installs everything in its own directory then puts a shortcut in the /usr/local directory, where it won't conflict with Apple installed programs. Many of the UNIX tools Apple bundles with macOS are older and out-of-date. Brew will install the latest version of the program without replacing Apple's pre-installed program, so nothing breaks. It's easy to remove any brew package without disrupting macOS. 

There are a few other commands that are useful to know.

Mac GUI apps are available with the'brew cask install` command. For example `brew cask install firefox`

`brew list` will show you all the brew packages you've installed.

To find a package in the brew database use the `brew search` command

`brew upgrade` will update all the packages you've installed. You'll want to run that from time to time to make sure everything is up-to-date.

My Mac has dozens of brew packages installed. A few goodies include:

`python`

`cowsay` 

my favorite shell`fish` 

`glances` 

`neofetch`

`howdoi` 

`nnn` 

`tldr` 

`wget`

`magic-wormhole`

To learn more about brew type man brew

Next week, using brew and something called brewfile to set up a new mac from scratch. 

Also, for next week, install `mas`. It's an easy way to install and update apps from the Mac App Store.

Leo Laporte gives you helpful tips to get the most from your Mac every week on Hands-On Mac.

Download or subscribe to this show at https://twit.tv/shows/hands-on-mac

Discuss episodes in the TWiT Community.

Links