Homebrew is the most popular package management tool for the 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.
How to Install Homebrew?
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. One the installation completed execute below command to check the version.
brew --version Homebrew 1.5.4 Homebrew/homebrew-core (git revision 1bf5; last commit 2018-02-12)
You may also run the below command to insure everything is configured correctly.
The above command will show the instructions for correcting any issues.
How to upgrade Homebrew?
To upgrade Homebrew, execute the command below in terminal prompt.
cd "$(brew --repo)" git fetch && git reset --hard origin/master && brew update
How to uninstall Homebrew?
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.