天天看點

brew更換鏡像為阿裡雲,清華大學慢死了

每次brew安裝新包的時候必先更新自身,網絡慢的時候brew update無限卡死,雖然按一次ctrl C可以跳過,但有時候恰恰是brew本身版本導緻的莫名其妙的問題出現,如果不把航空母艦更新了,後面也不會順利。

今天一怒之下,換了阿裡鏡像,果然一切迎刃而解了(原教派)

貼上iterm-bash腳本備查:

    cd "$(brew --repo)"

    git remote set-url origin https://mirrors.aliyun.com/homebrew/brew.git

    cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"

    git remote set-url origin https://mirrors.aliyun.com/homebrew/homebrew-core.git

    echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles' >> ~/.bash_profile

    source ~/.bash_profile

前兩步實際上就是去/usr/local/Homebrew目錄下把brew和brew-core的git路徑給換了,最後一步是二進制源需要修改bashprofile檔案改變量。