国内homebrew使用体验很的很差,主要问题是访问github速度太慢,经常卡死在update.
替换为中科大镜像,立即起飞.
首先替换Git repo
1 2 3 4 5 6 7 8 9 10 11 |
替换brew.git: cd "$(brew --repo)" git remote set-url origin https://mirrors.ustc.edu.cn/brew.git 替换homebrew-core.git: cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core" git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git 替换homebrew-cask.git: cd "$(brew --repo)/Library/Taps/caskroom/homebrew-cask" git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-cask.git |
然后替换Bottles
1 2 3 4 5 6 7 |
对于bash用户: echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.bash_profile source ~/.bash_profile 对于zsh用户 echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.zshrc source ~/.zshrc |
原创文章,转载请注明: 转载自贝壳博客
本文链接地址: 替换Homebrew源为中科大镜像