Macインストールhomebrewスローソリューション


最近homebrewを取り付けてもはしごを使わなくても遅いです.それからネットの方法を探しましたが、少し出入りして、最新の方法を記載します.

最初のステップ


端末を開いて次のコマンドを実行
curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh >> brew_install.sh

ステップ2


見つける
BREW_REPO = “https://github.com/Homebrew/brew“

次のように置き換えます.
BREW_REPO = "https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git"

最新版shファイルには下の命令がないので
CORE_TAP_REPO = “https://github.com/Homebrew/homebrew-core“

置換する必要はありません.ある場合は、下に置換します.
CORE_TAP_REPO = "https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git"

ステップ3


スクリプトをターミナルにドラッグすると、次の問題が発生します.
permission denied: ...

次のコマンドを実行します.
chmod 777 brew_install.sh

ステップ4


意外にも下に引っかかります.
==> Tapping homebrew/core
Cloning into ‘/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core’…

端末をオフにし、次のフォルダ/usr/local/Homebrew/Library/Tapsフォルダを削除します.
次に、次の操作を行います.
git clone git://mirrors.ustc.edu.cn/homebrew-core.git/ /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core --depth=1

ステップ5


homebrew-coreのミラーアドレスも中科院の国内ミラーに設定
cd $(brew --repo)
git remote set-url origin https://mirrors.ustc.edu.cn/brew.git
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git

これで終わりです.
参考以下の文章のハイパーチェーン1ハイパーチェーン2