How to install Homebrew on macOS

不言
不言Original
2019-03-30 14:48:193299browse

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 you must install it first. This article will introduce how to install Homebrew on your system using simple commands.

How to install Homebrew on macOS

#How to install Homebrew?

Launch the Terminal (/applications/utilities/terminal) application on your system and run the following commands on it.

$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

The installation process will prompt for a password. Just enter the password you need to complete the Homebrew installation. This process takes some time. After the installation is complete, execute the following command to check the version.

$ brew --version
Homebrew 1.5.4
Homebrew/homebrew-core (git revision 1bf5; last commit 2018-02-12)

You can also run the following command to make sure everything is configured correctly.

$ brew doctor

How to upgrade Homebrew?

To upgrade homebrew, execute the following command in the terminal prompt.

$ cd "$(brew --repo)" git fetch && git reset --hard origin/master && brew update

How to uninstall Homebrew?

To uninstall homebrew, execute the following command at the terminal prompt.

$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"

You can also download the uninstall script and run it as shown below to see more uninstall options.

$ ./uninstall --help

This article has ended here. For more other exciting content, you can pay attention to the Linux Video Tutorial column on the PHP Chinese website!

The above is the detailed content of How to install Homebrew on macOS. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn