Homebrew is the most popular package management tool for macOS systems. Using the brew command line utility you can easily add new packages on your mac, but first, you have to install it. This tutorial will help you to install Homebrew on your system using simple commands.
Install Homebrew on macOS
Launch the terminal (/Applications/Utilities/Terminal) application on your system and then run below command on it
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
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.
Once the installation completed, execute the below command to check version.
brew --version Homebrew 2.1.6 Homebrew/homebrew-core (git revision b2de; last commit 2019-06-19)
You may also run the below command to ensure everything is configured correctly.
The above command will show the instructions for correcting any issues.
To upgrade Homebrew, execute the command below in terminal prompt.
cd "$(brew --repo)" git fetch && git reset --hard origin/master && brew update
To uninstall Homebrew, execute the command below in a terminal prompt.
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
You can also download the uninstall script and run as below to view more uninstall options.