Table of Contents
1. Open up a Terminal window. You can find the Terminal app in either the Utilities folder or the Applications folder or search in the Spotlight. Then execute the following command:
url='https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh'
/bin/bash -c "$(curl -fsSL $url)"
2. The installation process will prompt for the password. Just enter your password where required to complete the Homebrew installation. The process will take some time.
Warning: /opt/homebrew/bin is not in your PATH.
Instructions on how to configure your shell for Homebrew
can be found in the 'Next steps' section below.
==> Installation successful!
...
==> Next steps:
- Run these three commands in your terminal to add Homebrew to your PATH:
echo '# Set PATH, MANPATH, etc., for Homebrew.' >> /Users/bonben/.zprofile
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/bonben/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
echo '# Set PATH, MANPATH, etc., for Homebrew.' >> /Users/bonben/.zprofile
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/bonben/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
3. Once the installation is completed, use the following command to check the version.
brew --version
bonben@Gradys-MacBook-Air ~ % brew --version
Homebrew 3.6.11
Homebrew/homebrew-core (git revision 8a1f0e9b4df; last commit 2022-11-15
4. You may also run the below command to ensure everything is configured correctly. The belowcommand will show the instructions for correcting any issues.
brew doctor
bonben@Gradys-MacBook-Air ~ % brew doctor
Your system is ready to brew.
Install Software Using Homebrew
bonben@Gradys-MacBook-Air ~ % brew search "firefox"
==> Formulae
firefoxpwa
==> Casks
homebrew/cask-versions/firefox-beta homebrew/cask-versions/firefox-esr
homebrew/cask-versions/firefox-developer-edition homebrew/cask-versions/firefox-nightly
This will show a list of programs that you’ll be able to install with Homebrew. The package name is usually shown somewhere in the middle of the list. For example, to install the latest Firefox, you’ll need to use the package name firefox.
bonben@Grady~ % brew install firefox
Running `brew update --auto-update`...
==> Tapping homebrew/cask
Cloning into '/opt/homebrew/Library/Taps/homebrew/homebrew-cask'...
remote: Enumerating objects: 687513, done.
remote: Counting objects: 100% (246/246), done.
remote: Compressing objects: 100% (178/178), done.
remote: Total 687513 (delta 123), reused 187 (delta 68), pack-reused 687267
Receiving objects: 100% (687513/687513), 326.20 MiB | 10.67 MiB/s, done.
Resolving deltas: 100% (488150/488150), done.
Tapped 4119 casks (4,191 files, 348.1MB).
==> Downloading https://download-installer.cdn..../106.0.5/mac/en-US/Firefox%20106.0.5.dmg
######################################################################## 100.0%
==> Installing Cask firefox
==> Moving App 'Firefox.app' to '/Applications/Firefox.app'
🍺 firefox was successfully installed!
bonben@Grady~ % brew uninstall firefox
==> Uninstalling Cask firefox
==> Backing App 'Firefox.app' up to '/opt/homebrew/Caskroom/firefox/106.0.5/Firefox.app'
==> Removing App '/Applications/Firefox.app'
==> Purging files for version 106.0.5 of Cask firefox
Upgrade Homebrew
You should also keep the homebrew up to date. Execute the following command to upgrade the Homebrew to the latest version.
cd "$(brew --repo)" git fetch && git reset --hard origin/master && brew update
Uninstall Homebrew
Similar to installation Homebrew also provides you a script to uninstall it. Open a terminal and execute the following command to remove Homebrew from your system.
url='https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh'
/bin/bash -c "$(curl -fsSL $url)"
Conclusion
Installing third-party software can be a pain, especially if that software doesn’t come with a macOS installer. Homebrew offers a more flexible alternative that allows you to install almost any piece of software that you can imagine.
It’s a fantastic tool that will save you a lot of time and effort in the long run. However, it’s important to note that Homebrew is not supported by Apple. This means that if there’s a new version of macOS, the folks behind Homebrew will probably release a new version. But if Apple updates its operating system, you’ll likely have to wait a while before you see a new version of Homebrew.