Under Mac Homebrew replacement mirror

Alternatively git mirror source and homebrew

A, git accelerate

  1. Find the address corresponding to the domain name
    nslookup github.com
    nslookup github.global.ssl.fastly.Net
  2. Modify the hosts file

    sudo vim /etc/hosts
    # add two lines at the end.
    31.13.66.1 github.global.ssl.fastly.net 
    13.229.188.59 github.com
  3. Flush the DNS cache (depending on your operating system selection)

    # Mac
    sudo killall -HUP mDNSResponder
    # linux
    sudo /etc/init.d/networking restart

Two, homebrew replaced Tsinghua mirroring

Tsinghua mirror sites: Tsinghua mirror sites

homebrew replace Guide: Help Documentation

git -C "$(brew --repo)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git
git -C "$(brew --repo homebrew/core)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
git -C "$(brew --repo homebrew/cask)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask.git
brew update

Guess you like

Origin www.cnblogs.com/cpl9412290130/p/12148705.html