Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between brew install XXX and brew cask install XXX

Tags:

homebrew

People also ask

What is the difference between brew install and brew cask install?

brew cask is an extension to brew that allows management of graphical applications through the Cask project. Homebrew Cask extends Homebrew and brings its elegance, simplicity, and speed to OS X applications and large binaries alike. Cask deals with a mixture of software and licences.

What is brew cask vs brew?

brew cask is an extension to standard brew based software management, it's a type of formula that documents the process of installing a graphical application (and not entirely coincidentally closed-source software).

What is Homebrew cask Mac?

Homebrew-Cask extends Homebrew and allows you to install large binary files via a command-line tool. You can for example install applications like Google Chrome, Dropbox, VLC and Spectacle. No more downloading . dmg files and dragging them to your Applications folder!

What does brew install do?

When we run brew install, Homebrew reads our package's Formula — an implementation of Ruby's abstract Formula class that provides package metadata and installation instructions — to create an executable from our source code and install it locally on our computer.


Homebrew-Cask is an extension to Homebrew to install GUI applications such as Google Chrome or Atom. It started independently but its maintainers now work closely with Homebrew’s core team.

Homebrew calls its package definition files “formulae” (British plural for “formula”). Homebrew-Cask calls them “casks”. A cask, just like a formula, is a file written in a Ruby-based DSL that describes how to install something.

The Cellar is where Homebrew installs things. Its default path is /usr/local/Cellar. It then add symlinks from standard locations to it.

For example, when you type brew install git:

  1. Homebrew installs it under /usr/local/Cellar/git/<version>/, with the git binary in /usr/local/Cellar/git/<version>/bin/git
  2. It adds a symlink from /usr/local/bin/git to that binary

This allows Homebrew to keep track of what’s installed by Homebrew versus software installed by other means.

A tap is a source of formulae. The default is homebrew/core but you can add more of them. The simplest way to create a formula for your own software is to create a GitHub repository called homebrew-<something>; put your formula file in it; then type brew tap <username>/<something> to add this new source of formulae to your Homebrew installation and so get access to all its formulae.

Some companies have internal Homebrew taps for their own utilities. There are a lot of public taps like atlassian/tap for Atlassian software, or ska-sa/tap for radio astronomy. Homebrew itself used to have additional taps like homebrew/science but they deprecated them and imported the formulæ in homebrew/core.


I personally differentiate brew & cask just based on 1 of the main (if not the only main) differences, of graphical GUI applications being managed by cask rather than just brew. (There are other differences too which I don't know as much about).

Below adapted from 'Graham Miln' on apple.stackexchange:

Homebrew

brew is the core command for the Homebrew project.

The missing package manager for OS X

Homebrew installs the stuff you need that Apple didn’t.

Homebrew typically deals with command line software (not graphical GUI applications). Most of the software is distributed under an open source licence.

Cask

brew cask is an extension to brew that allows management of graphical GUI applications.

Homebrew Cask extends Homebrew and brings its elegance, simplicity, and speed to OS X applications and large binaries alike.

Cask deals with a mixture of software and licences.

Cask offers a way to command line manage the installation of graphical GUI applications.

Licensing

Availability through brew or cask does not imply any specific licence.


Quoting from official docs:

Cask

https://github.com/Homebrew/homebrew-cask

Homebrew Cask extends Homebrew and brings its elegance, simplicity, and speed to the installation and management of GUI macOS applications such as Atom and Google Chrome.

Cellar

https://docs.brew.sh/Formula-Cookbook

Homebrew installs to the Cellar and then symlinks some of the installation into /usr/local so that other programs can see what’s going on.

Tap

https://docs.brew.sh/Taps

Taps (Third-Party Repositories)

brew tap adds more repositories to the list of formulae that brew tracks, updates, and installs from. By default, tap assumes that the repositories come from GitHub, but the command isn’t limited to any one location.