Learn Homebrew: Fast and Efficient Software Management on macOS
Homebrew makes managing software on macOS fast and easy. With simple commands, you can install, update, and organise apps. Ready to streamline your macOS experience? Let’s get started!
What It Is #
Homebrew is a command-line package manager for macOS that simplifies software management. It automates installation, updates, and organisation of apps, eliminating manual downloads and complicated setups to keep your system running smoothly and up to date.
Why Use It #
Save time, keep your system tidy, and make your workflow smoother.
1. Fast Software Installation #
No more manual downloads from websites and dragging apps to the Applications folder. With a simple command, you can install a wide range of software:
brew install <package_name>
2. Access to Thousands of Packages #
Homebrew has a massive collection of command-line tools and casks (GUI apps) via:
- Core packages (CLI tools):
brew install
- Cask packages (GUI apps):
brew install --cask
3. Easy Updates #
Keep all your packages updated with a single command:
brew update && brew upgrade
4. Clean Uninstallation #
Remove packages without leaving junk behind:
brew uninstall <package_name>
5. Lightweight and Non-Intrusive #
Homebrew installs everything in /opt/homebrew
(Apple Silicon) or /usr/local
(Intel), keeping your system clean and organized. It doesn’t clutter system directories or require sudo.
6. Scriptable Setup #
Pro tip: Use a Brewfile and brew bundle
to install all your favourite packages at once.
Set up your Mac automatically:
brew bundle dump
brew bundle install
Installation #
macOS:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Essential Commands #
1. Package Management #
Casks are apps with a graphical interface. Examples: LibreWolf and Visual Studio Code.
Install package (latest version):
brew install <package_name>
brew install --cask <package_name>
Install multiple packages:
brew install ffmpeg imagemagick rclone
brew install --cask iterm2 librewolf visual-studio-code
Combined:
brew install ffmpeg imagemagick rclone && brew install --cask iterm2 librewolf visual-studio-code
Uninstall package:
brew uninstall <package_name>
brew uninstall --cask <package_name>
2. Updates & Upgrades #
Update Homebrew:
brew update
Upgrade installed packages:
Upgrade all the installed packages to latest version.
brew upgrade
Update Homebrew and installed packages:
brew update && brew upgrade
Upgrade specific package:
brew upgrade <package_name>
Upgrade all casks (GUI apps):
brew upgrade --cask
Pin package to prevent upgrade:
brew pin <package_name>
To allow upgrades again:
brew unpin <package_name>
3. Package Info #
List installed packages:
brew list
Get package info:
brew info <package_name>
List all packages with newer versions available:
brew outdated
Search for package:
brew search <package_name>
List all casks (GUI apps):
brew list --cask
4. System Maintenance & Cleanup #
Cleanup old versions:
Remove old versions of installed packages and free up disk space.
brew cleanup
Check system compatibility:
Check system for issues, such as configuration problems or outdated files.
brew doctor
Fix installation issues:
Use to identify any missing dependencies for installed packages.
brew missing
5. Configuration #
Show Homebrew configuration:
brew config
Homebrew analytics
Disable:
brew analytics off
Enable:
brew analytics on
6. Advanced Features #
Create a Brewfile (save in current directory):
Create a list of installed packages.
brew bundle dump
If a Brewfile already exists, use:
brew bundle dump --force
Create a Brewfile (save in custom directory):
brew bundle dump --file=<path/to/>Brewfile
Install from Brewfile (default path):
Default path: ~/Brewfile
.
brew bundle install
Install from Brewfile (custom path):
brew bundle --file=<path/to/>Brewfile
7. Handling Services #
Start:
brew services start <package_name>
Stop:
brew services stop <package_name>
Restart:
brew services restart <package_name>
List running services:
brew services restart <package_name>
8. Handling Errors & Logs #
View logs:
brew log <package_name>
Force reinstall:
brew reinstall <package_name>
My Favorite Packages #
These are the essential packages I always install on a fresh macOS setup:
Core Packages (CLI Tools) #
bat
– Acat
clone with syntax highlighting.bitwarden-cli
– Command-line access to your Bitwarden vault.coreutils
– GNU core utilities, replaces many BSD/macOS defaults with GNU versions.curl
– Tool for transferring data with URLs, supports multiple protocols.ffmpeg
– Powerful tool for video and audio processing.gd
– Graphics library for dynamic image creation (used in web and image tools).htop
– Interactive process viewer, better thantop
.imagemagick
– Suite for editing, converting, and displaying images from the command line.rclone
– Command-line tool for syncing files with cloud storage providers.rsync
– Fast and versatile file-copying tool, ideal for backups and remote sync.
Cask Packages (GUI Apps) #
bitwarden
– Secure, open-source password manager.librewolf
– Privacy-focused Firefox fork with hardened defaults.lulu
– Free, open-source firewall for macOS.malwarebytes
– Malware scanner and removal tool for macOS.oversight
– Alerts you when your mic or camera is activated.spotify
– Popular music streaming application.iterm2
– A more capable terminal than the default macOS Terminal.visual-studio-code
– Popular code editor with a huge ecosystem.vlc
– Versatile media player that supports virtually every format.vmware-fusion
– Virtualization software for running other operating systems on macOS.