mac installation homebrew/brew encounters 443 error

Problem Description

The full name of brew is Homebrew, which is a software package management tool on Mac OSX.

If you want to install it on a mac terminal, run the instructions provided online.

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

Encountered a 443 error

The reason is simple, because you can't open raw.githubusercontent.com at all!

As for why it can't be opened, as the saying goes, life is a wall, and people inside the wall want to get out... (I'm going too far)

Solution

We can only seek the mirror source. There are two methods:

  1. Install it yourself using a mirror source
  2. Fully automatic script packaged by others

As aseniorprogrammer (fake), of course I choose 1

method one

Run the mirror source of USTC

export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.ustc.edu.cn/brew.git"
export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.ustc.edu.cn/homebrew-core.git"
export HOMEBREW_BOTTLE_DOMAIN="https://mirrors.ustc.edu.cn/homebrew-bottles"
export HOMEBREW_API_DOMAIN="https://mirrors.ustc.edu.cn/homebrew-bottles/api"

/bin/bash -c "$(curl -fsSL https://mirrors.ustc.edu.cn/misc/brew-install.sh)"

After waiting for a while, the installation is successful. Then, you need to execute the following two pieces of code according to the prompts:
Insert image description here

  1. Add path locally
(echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> /Users/这里是你的mac用户名/.zprofile
    eval "$(/opt/homebrew/bin/brew shellenv)"
  1. Add Git remote mirror source to avoid "encountering a wall around the corner" during the brew install process
echo '# Set PATH, MANPATH, etc., for Homebrew.' >> /Users/这里是你的mac用户名/.zprofile
echo 'export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.ustc.edu.cn/brew.git"' >> /Users/这里是你的mac用户名/.zprofile
echo 'export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.ustc.edu.cn/homebrew-core.git"' >> /Users/这里是你的mac用户名/.zprofile
export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.ustc.edu.cn/brew.git"
export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.ustc.edu.cn/homebrew-core.git"

Then run brew help, if the following prompt pops up, the installation is successful

Example usage:
  brew search TEXT|/REGEX/
  brew info [FORMULA|CASK...]
  brew install FORMULA|CASK...
  brew update
  brew upgrade [FORMULA|CASK...]
  brew uninstall FORMULA|CASK...
  brew list [FORMULA|CASK...]

Troubleshooting:
  brew config
  brew doctor
  brew install --verbose --debug FORMULA|CASK

Contributing:
  brew create URL [--no-fetch]
  brew edit [FORMULA|CASK...]

Further help:
  brew commands
  brew help [COMMAND]
  man brew
  https://docs.brew.sh

Method Two

This way is relatively simple, just run the script directly

/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"

Then just follow the prompts
Insert image description here
If you don’t know how, you can refer to: Install brew on Mac (the latest tutorial, absolutely feasible, it can be done with one line of code, no Report an error)

references

  1. Mac installation Brew (Homebrew) domestic mirror source acceleration
  2. Install brew on Mac (latest tutorial, absolutely feasible, one line of code, no errors)

Guess you like

Origin blog.csdn.net/iteapoy/article/details/134701525