Package Managers
How to install, update, and manage software from the command line using your platform's package manager
A package manager is like an app store for the terminal. Instead of searching the web for installers and clicking through setup wizards, you type one command and the software downloads, installs, and configures itself. Package managers also handle updates and dependencies (other software your app needs to run), so everything stays current and nothing breaks.
macOS doesn't ship with a package manager, but Homebrew is the standard choice. Almost every developer tool and many regular apps can be installed through it.
Installing Homebrew
- Open Terminal (Cmd + Space, type "Terminal")
- Paste the install command from brew.sh:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" - Follow the prompts – it will ask for your password and install Apple's Command Line Tools if needed
- After installation, follow any instructions it prints about adding Homebrew to your PATH (especially on Apple Silicon Macs where it installs to
/opt/homebrew)
Installing software
brew install git
That's it. Homebrew downloads and installs git and anything it depends on.
For GUI apps (like browsers, editors, chat apps), use the --cask flag:
brew install --cask firefox
brew install --cask visual-studio-code
brew install --cask slack
Updating everything
brew update
This updates Homebrew's list of available packages. Then:
brew upgrade
This upgrades all installed packages to their latest versions.
Removing software
brew uninstall git
Useful commands
brew list– see everything you've installedbrew search name– search for a packagebrew info name– get details about a packagebrew doctor– check for common problems with your Homebrew setupbrew cleanup– remove old versions and free up disk space
Good packages to install first
git– version controlwget– download files from the terminaltree– visualize folder structuresjq– work with JSON datahtop– better process viewer than Activity Monitor
Frequently Asked Questions
Why use a package manager instead of downloading installers from websites?▾
Package managers handle updates automatically, manage dependencies (software your app needs), and let you install or remove software with one command. You also avoid hunting for download links and clicking through setup wizards. It's faster, cleaner, and easier to keep everything up to date.
Can I break my system by installing packages?▾
It's very unlikely with standard packages from official repositories. Package managers check for conflicts before installing. The main risk is adding unofficial or third-party repositories with untested software – stick to official sources and you'll be fine.
How do I know what packages are available?▾
Use the search command (brew search, winget search, apt search, etc.) or browse the package manager's website. Homebrew has formulae.brew.sh, winget packages are on winget.run, and Linux distros have their own package search sites.
Do I need to run updates manually?▾
Yes, for most package managers. Run your update command periodically (once a week is a good habit) to keep everything current. Some Linux distros offer automatic security updates, and you can configure unattended upgrades if you prefer.
Can I use multiple package managers on the same system?▾
Yes. On Windows, winget and Chocolatey coexist fine. On Linux, you might use apt for system packages and Flatpak for desktop apps. On macOS, Homebrew is typically all you need, but you can also use the Mac App Store alongside it. Just be aware that installing the same software from two different package managers can cause version conflicts.