Installing the package manager Homebrew.
Most of the apps that you install on macOS are provided by Apple themselves and you can get them via Mac App Store. Another way to get Apple software is to download them from the Apple Developer website; here, you find, in particular, older versions of the Apple products (that aren't anymore available in the Store). Concerning 3rd party software, you can do as you do on Windows: download it and install it. A great part of such software is available as Mac package (.pkg file), that you can compare with a windows setup program (sometimes the PKG is delivered as the content of a DMG disk image). However, there is a more elegant way to do: Similar to what you do on Linux, using a package manager, that allows a more coherent installation of apps, as well as a simple way to uninstall a given package.
Homebrew is said to be the Missing Package Manager for macOS (or Linux). For details and the software documentation, please, visit the Homebrew website. Some interesting aspects concerning Homebrew:
- With Homebrew you can easily install software provided by vendors other than Apple
- Homebrew installs packages to their own directory and then symlinks their files into /usr/local (on macOS Intel).
- Homebrew gives you the possibility to create your own packages.
- Homebrew makes it easy to modify and uninstall a given package.
To install Homebrew with all defaults, open a terminal and run the command (your password will be asked to do so):
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
The setup script informs you that the owner of the subdirectories of /usr/local will be changed to the current user and the group to "admin". There are also several new folders to be created in /usr/local. You'll have to hit the ENTER key to confirm and start installation.
Installation should normally proceed without problems. In the terminal window, you will see the message "Installation successful!", together with some important information concerning the next steps to make, analytics, donations and the online documentation.
The important point is that you have to add Homebrew to your path. In a terminal, run the following two commands:
(echo; echo 'eval "$(/usr/local/bin/brew shellenv)"') >> /Users/{user-name}/.zprofile
eval "$(/usr/local/bin/brew shellenv)"
Homebrew's analytics (cf. Homebrew documentation) are enabled by default. To prevent analytics to ever be sent, run the command
brew analytics off
To get help with the Homebrew commands, type
brew help
Homebrew is a rather complex software (with lots of possibilities) and describing its usage is outside the aim of this help text. Just some things that you should know (for a detailed description of Homebrew, please, visit the Homebrew Documentation website):
- A Homebrew package (more exactly: a package definition built from upstream sources) is called formula
(sometimes a package is available as pre-build binaries; in this case it's called bottle). To install a formula (ex: the command
line web browser "wget"), use the command:
brew install wget - A Homebrew package definition that installs macOS native applications is called cask. To install a
cask (ex: the web browser "Firefox"), use the command:
brew install --cask firefox - A tap is a directory of formulae, casks and/or external commands. This is usually a Git repository,
but may also be a URI on an Internet server (allowing, in particular, to install a given version from a given source), or a local path (allowing to install
a package with its formula or cask being stored on your own computer). To tap a formula repository, use the command:
brew tap [options] [repository] -
Some further important commands:
- brew search <formula>: Search for formulae.
- brew info <formula>: Get supplementary information about a formula.
- brew upgrade <formula>: Update a formula.
- brew uninstall <formula>: Uninstall a formula.
If you find this text helpful, please, support me and this website by signing my guestbook.