Homebrew is a popular package manager for Mac OSX. Package managers make it easier to install and update software on your computer.
The basics of Homebrew are outlined below. You can go to the Homebrew website and the Homebrew GitHub Page to learn more.
To install Homebrew, you need to have Command Line Tools for Xcode installed. It comes with Xcode. If you don't want to download Xcode, you can run this command:
xcode-select --install
or download it from here.
Then, run the following command in the Terminal to install Homebrew:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
To make sure that everything worked, run this:
brew doctor
Install a package:
brew install <package name>
For example, one way to install git on a Mac is to run this:
brew install git
Uninstall a package:
brew uninstall <package name>
brew uninstall <package name> --force # to uninstall all versions
To remove old versions of packages:
brew cleanup
List all installed packages:
brew list
Update Homebrew:
brew update
Upgrade packages:
brew upgrade # to upgrade all packages
brew upgrade <package name> # to upgrade a particular package