Skip to main content
  1. Posts/

Homebrew: Package Manager For MacOS

·2 mins

A package manager is an essential tool for every OS. macOS doesn’t have a built-in package manager, but there exist some solutions. Let’s take a look at one of them, Homebrew, powered by Ruby and Git.

The installation itself is simple, just execute the following command in terminal.

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Now you should have access to brew command. Try brew commands which lists all possible commands, so now I would like to run you through some of them.

Homebrew commands #

# installs <package>
brew install <package>
# uninstalls <package>
brew uninstall <package>

# lists all installed packages
brew list
# lists installed packages without dependencies
brew leaves

# searches for a packages or a casks by given <text>
brew search <text>

# switches analytics on or off
brew analytics [on|off]
# displays anonymous user behavior - https://docs.brew.sh/Analytics
brew analytics state

# removes outdated downloads for packages and Casks
brew cleanup
# checks  your  system  for  potential  problems
brew doctor
# displays information about the package
brew info <package>

# shows packages that have an updated version available
brew outdated
# fetches the newest version of Homebrew and packages
brew update
# upgrades outdated packages
brew upgrade

Homebrew Services #

Homebrew Services provides an easier way to manage background services with macOS’ launchctl daemon manager. Instead of creating .plist files Homebrew Services takes out the hassle and manages files for you.

# runs the service without registering it to launch at boot
brew services run <service>
# starts the service and registers it to launch at boot
brew services start <service>
# stops the service and unregisters it from launching at boot
brew services stop <service>
# stops and starts the service and registers it to launch at boot
brew services restart <service>
# lists all running services for the current user
brew services list
# removes all unused services
brew services cleanup

Homebrew Cask #

Homebrew Cask is a tool for installing precompiled macOS apps from the command-line.

brew cask install <app>
brew cask uninstall <app>
brew cask info <app>

# list all the installed Casks
brew cask list
# display all the installed Casks that have newer versions available
brew cask outdated
# upgrade all the installed Casks that have newer versions available
brew cask upgrade

Resources: