Catalog / Homebrew Cheat Sheet
Homebrew Cheat Sheet
A comprehensive guide to Homebrew, the package manager for macOS. This cheat sheet covers installation, basic commands, package management, and troubleshooting.
Installation and Setup
Installation
To install Homebrew, open your terminal and run the following command:
|
This script will guide you through the installation process. Follow the prompts, and enter your password if required. |
Basic Setup
After installation, it’s important to add Homebrew to your Add these lines to your
|
Then, apply the changes to your current session:
|
Alternatively, for interactive setup in
|
Verify Installation
To ensure Homebrew is installed correctly, run:
This command will diagnose common issues and provide solutions. |
If any problems are reported, follow the suggested steps to resolve them before proceeding. |
Package Management
Installing Packages
|
Installs the specified package. Example:
|
|
Reinstalls the specified package. Useful for fixing broken installations. Example:
|
|
Installs a specific version of a formula. Example:
|
Updating Packages
|
Updates Homebrew’s package list. |
|
Upgrades all outdated packages. |
|
Upgrades a specific package. Example:
|
Removing Packages
|
Uninstalls the specified package. Example:
|
|
Removes old versions of packages from the Homebrew cache. |
|
Removes old versions of specific packages from the Homebrew cache. Example:
|
Brew Cask
Installing Applications
|
Installs the specified application using Brew Cask. Example:
|
|
Reinstalls the specified application using Brew Cask. Example:
|
Listing Installed Applications
To list all applications installed via Brew Cask, use the following command:
|
Uninstalling Applications
|
Uninstalls the specified application using Brew Cask. Example:
|
Advanced Usage
Searching for Packages
|
Searches for packages containing the specified keyword. Example:
|
|
Searches using a regular expression. Example:
|
Package Information
|
Displays information about a package, including version, dependencies, and caveats. Example:
|
|
Lists the dependencies of a package. Example:
|
Linking and Unlinking
|
Links a package’s files into Example:
|
|
Unlinks a package’s files from Example:
|