每次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檔案改變數,
完后再執行一次brew update,是不是神清氣爽?
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/178.html
標籤:OS X
上一篇:brew 安裝 docker
