Learn how to install and the essential to get by with Homebrew for macOS
MacOS is an operational system based on Unix kernel, and despite Apple provides an AppStore like some sort of package manager, it lacks a lot of important stuff, specially if you are an advanced user or a developer. With this in mind, community created the Homebrew or just brew project, which is a command line package manager that owns a organised and very extensive repository of packages and apps (casks), and is widely used by Mac users.
In this guide I’ll show how to install Homebrew and also some basic commands to install, remove and update packages and apps.
Intel 64 bits processor
macOS 10.12 or higher
Command Line Tools (CLT) for Xcode (install it via AppStore or https://developer.apple.com/downloads)
With all requirements installed, brew installation is really easy. Brew is a ruby based project, so, just open your favorite terminal and execute the following command:
/usr/bin/ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)
With Homebrew installed in your machine, open the terminal and start using brew. Use the quick reference below to manipulate packages:
brew search ${package_or_cask_approximate_name}
brew list
brew install ${package_name}
brew remove ${package_name}
brew upgrade ${package_name}
or to update all your packages (including homebrew itself)
brew upgrade
brew info ${package_name}
Homebrew also has an extension named cask. Its goal is to provide the same experience of brew core, but for the installation of Mac desktop apps. The usage is quite similar to the previous commands:
brew install ${cask_name} --cask
brew list --cask
brew remove ${cask_name} --cask
brew upgrade ${cask_name} --cask
or to update all your casks
brew upgrade --cask
brew info ${cask_name} --cask
Other thing that is worth a lot mentioning is the ability to manage daemons directly from brew, without using the native launchctl.
brew services list
brew services run ${service_name}
brew services stop ${service_name}
brew services restart ${service_name}
Homebrew eases the life of macOS users and specially those who are developers. As brew is a very mature and extensive software there may be other abilities not mentioned here in case you want to go deeper. Use the documentation for more information.
See you soon!
Legal Stuff