Homebrew is a package management tool for MAC. Both installation and uninstallation can be performed using commands. Installed applications are stored in the /use/local directory for easy management.

The website address

Install command

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
Copy the code

Question 1

Failed to connect to raw.githubusercontent.com port 443: Connection refused

This may be a DNS problem. You can set up the following DNS

DNS: Google: 8.8.8.8 Ali: 223.5.5.5 or 223.6.6.6Copy the code

Problem 2: HomebreW-Core and Home-Cask download slowly

Will get stuck in the script line for a long time:

Cloning into ‘/usr/local/Homebrew/Library/Taps/homebrew/homebrew-xxx’…

Solution: Manually download core and CASk

homebrew-core:

/ / download git clone git://mirrors.ustc.edu.cn/homebrew-core.git/ / usr/local/Homebrew/Library/Taps/Homebrew/Homebrew - core --depth=1Copy the code

homebrew-task:

/ / download git clone git://mirrors.ustc.edu.cn/homebrew-cask.git/ / usr/local/Homebrew/Library/Taps/Homebrew/Homebrew - cask --depth=1Copy the code

Modify the mirror source

If you have experienced problem 2, just change the brew mirror source

//brew
cd "$(brew --repo)"
git remote set-url origin https://mirrors.nwafu.edu.cn/brew.git
//core
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.nwafu.edu.cn/homebrew-core.git
//cask
cd "$(brew --repo)"/Library/Taps/homebrew/homebrew-cask
git remote set-url origin https://mirrors.nwafu.edu.cn/homebrew-cask.git
Copy the code

The brew update

brew update

To install historical Versions, use Cask Versions

git clone git://mirrors.ustc.edu.cn/homebrew-cask-versions/ /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask-versions --depth=1
Copy the code

Brew failed to install java8

The details can be seen:Java8 is installed on the MAC using brew

My SDK version: 8U261

File link password: A9bh

Refer to the link

Mac HomeBrew Domestic image installation method

Northwest A&F University Mirror Management