brew 换源

2020-10-29/2021-07-15
0 评论 144 浏览

参考文献:

清华换源
homebrew长时间停在Updating Homebrew 这个步骤
Homebrew/Linuxbrew 镜像使用帮助
Homebrew-bottles 镜像使用帮助

问题:brew 一直 updating homebrew

阿里镜像有点垃圾,建议清华镜像

方法一

Control + c 取消本次操作,就可以继续进行了

方法二

1vim .zshrc
2export HOMEBREW_NO_AUTO_UPDATE=true

方法三

 1git -C "$(brew --repo)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git
 2git -C "$(brew --repo homebrew/core)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
 3git -C "$(brew --repo homebrew/cask)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask.git
 4git -C "$(brew --repo homebrew/cask-fonts)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask-fonts.git
 5git -C "$(brew --repo homebrew/cask-drivers)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask-drivers.git
 6# 更换后测试工作是否正常
 7brew update
 8
 9echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles' >> ~/.bash_profile
10source ~/.zshrc

复原方法:

 1git -C "$(brew --repo)" remote set-url origin https://github.com/Homebrew/brew.git
 2git -C "$(brew --repo homebrew/core)" remote set-url origin https://github.com/Homebrew/homebrew-core.git
 3git -C "$(brew --repo homebrew/cask)" remote set-url origin https://github.com/Homebrew/homebrew-cask.git
 4git -C "$(brew --repo homebrew/cask-fonts)" remote set-url origin https://github.com/Homebrew/homebrew-cask-fonts.git
 5git -C "$(brew --repo homebrew/cask-drivers)" remote set-url origin https://github.com/Homebrew/homebrew-cask-drivers.git
 6
 7# 更换后测试工作是否正常
 8brew update
 9
10vim .zshrc
11# 删除下行
12echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles'
评论
发表评论
       
       
取消