Homebrew is a popular package manager for macOS that makes it easy to install and manage software packages on your system. Here’s a cheat sheet with some common Homebrew commands:
Installation
Install Homebrew:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Package Management
Install a Package:
brew install <package>
Search for a Package:
brew search <keyword>
List Installed Packages:
brew list
Show Information about a Package:
brew info <package>
Update Homebrew and Upgrade Packages:
brew update
brew upgrade
Uninstall a Package:
brew uninstall <package>
Tap
Add a Tap (Additional Repositories):
brew tap <tap_name/tap_url>
List Taps:
brew tap
Troubleshooting
Check for Issues:
brew doctor
Remove Dead Symlinks:
brew cleanup
Homebrew Services
Start a Service:
brew services start <service_name>
Stop a Service:
brew services stop <service_name>
Homebrew Cask (for GUI Applications)
Install a GUI Application:
brew install --cask <app_name>
List Installed Casks:
brew list --cask
Update Casked Applications:
brew upgrade --cask
Homebrew Analytics
Opt-out of Homebrew Analytics:
brew analytics off
Miscellaneous
Open the Homebrew GitHub Repository:
brew home
Edit the Homebrew Configuration:
brew edit
These commands cover some of the common tasks you might perform with Homebrew. For more detailed information and options, refer to the official Homebrew documentation.