Homebrew part 1: Package manager terms explained
Mobilefish.com Mobilefish.com
28.3K subscribers
3,338 views
0

 Published On Jul 26, 2021

If you like this video and want to support me, go this page for my donation Paypal or crypto addresses:
   / mobilefish  

This is part 1 of the Homebrew series.

In this tutorial I will explain will explain often used Homebrew package manager terms, such as formula, bottle, cellar, keg, cask and tap.

This presentation can be found at:
https://www.mobilefish.com/download/h...

All my Homebrew videos and presentations can be found at:
https://www.mobilefish.com/developer/...

Homebrew is a free and open-source package management system for Unix-like operating systems.
Homebrew is popular on macOS.
To install Homebrew:
- Goto: https://brew.sh/ and copy the online installation instruction.
- Paste the instruction in your terminal.

The package will be installed in the cellar:
/usr/local/Cellar

The installed packages are symlinked into /usr/local
Which actually means symlinked into (if needed):
/usr/local/bin
/usr/local/lib
/usr/local/include

The packages are also symlinked into:
/usr/local/opt

Homebrew prefers installing within directory /usr/local
Apple has assigned this directory for non-system utilities.
This means there are no files in /usr/local by default, so there is no need to worry about messing up existing tools or system tools.
The /usr/local/bin directory must take precedence over /bin, /usr/bin, /sbin and /usr/sbin, see .bash_profile.

Formula is a Ruby script which defines the package (= software).
The formula contains information such as:
- Where the package tar ball, containing the package source, can be downloaded from.
- What package dependencies it has.
- How to install the package.

FORMULA
The formulae on the macOS can be found at:
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/<package-name>.rb
The default Homebrew formulae Git location:
https://github.com/Homebrew/homebrew-...

BOTTLE
Homebrew provides pre-compiled versions for many formulae.
These pre-compiled versions are referred to as bottles and are available at:
https://github.com/Homebrew/homebrew-...

Homebrew aims to bottle everything and these pre-built binary packages are simple gzipped tarballs of compiled binaries.
The bottles were hosted at https://homebrew.bintray.com/bottles but as of May 1, 2021 the Bintray hosting provider was shut down.
The Homebrew's binary packages are migrated to GitHub Packages:
https://github.com/orgs/Homebrew/pack...

Homebrew 3.1.0+ will have the new default download location.
Just like formulae and casks, bottles are installed in the cellar:
/usr/local/Cellar

CELLAR
Homebrew downloads and installs packages in the cellar directory.
The cellar location: /usr/local/Cellar

KEG
As mentioned earlier a package is installed in the cellar.
Each package is installed in its own directory followed by the version number.
The combination package name and version number is referred to as keg.

KEG-ONLY
Keg-only means the formula is only installed in the cellar and the packages are not symlinked into /usr/local (meaning /usr/local/bin, /usr/local/lib or /usr/local/include).
Homebrew automatically installs a package as keg-only if it detects the new package will cause problems with an already installed package (e.g. version incompatibilities).
For example the new package shadows a version of a library that ships with macOS, and superseding macOS libraries can cause problems.
As mentioned earlier the keg-only packages are not symlinked into /usr/local but they are symlinked into /usr/local/opt.
For example, gettext is keg-only, which means it is not symlinked into /usr/local

CASK
Cask is an extension of Homebrew.
Just like a formula they are Ruby scripts but they are used to download and install GUI applications.
The Casks on the macOS can be found at:
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask/Casks/<package-name>.rb
The default casks Git location:
https://github.com/Homebrew/homebrew-...

TAP
A tap refers to a Git repository and the repository name starts with "homebrew-"
By default homebrew uses the following git repositories:
https://github.com/Homebrew/homebrew-...
https://github.com/Homebrew/homebrew-...
https://github.com/Homebrew/homebrew-...

The command brew tap without arguments lists the currently tapped repositories:
- Core formulae for the Homebrew package manager:
homebrew/core
- Installation and management of GUI macOS applications:
homebrew/cask
- Manage background services with macOS launchctl daemon manager.
homebrew/services

<user>/<repository-name>
The actual Git location will be:
https://github.com/<user>/homeb...

Subscribe to my YouTube channel:
   / @mobilefish  

#mobilefish #brew #homebrew

show more

Share/Embed