Last update: 2025-03-17
Homebrew, a popular package manager for macOS and Linux, simplifies software installation, management, and removal. It’s known for its ease of use and extensive library of packages, called “formulae” (core packages and CLI tools) and “casks” (GUI applications). Here are some of the cool things about Homebrew:
/opt/homebrew
(on Apple
Silicon).brew install —cask firefox
and
you’re good to go!brew update
brew --version
brew upgrade
brew cleanup
brew list
brew info pandoc
brew reinstall obsidian
#!/bin/bash
set -e # Exit immediately if a command fails
start_time=$(date +%s)
echo "🔍 Checking for Homebrew updates…"
brew update
# Capture outdated package list
outdated=$(brew outdated)
if [[ -z "$outdated" ]]; then
echo "✅ No outdated formulas found. Your system is up to date!"
else
echo "📋 Outdated formulas found:"
echo "$outdated"
read -p "⚠️ Upgrade all formulas and casks? (y/n) " choice
if [[ "$choice" =~ ^[Yy]$ ]]; then
echo "⬆️ Upgrading formulas and casks…"
brew upgrade && brew upgrade --cask
echo "🧹 Running cleanup…"
brew cleanup
else
echo "🚫 Upgrade canceled."
exit 0
fi
fi
elapsed_time=$(( $(date +%s) - start_time ))
echo "✅ Homebrew maintenance completed in $elapsed_time seconds!"
Also 2025-03-17: Package Managers