首页 > 系统服务 > 详细

macOS的Homebrew换国内源

时间:2020-02-07 01:22:43      阅读:92      评论:0      收藏:0      [点我收藏+]

搜索了网上的该内容,都告诉如下方法:但是我用了C-shell,所以没有$(brew --repo)变量,实际上该变量就是指向目录:/usr/local/Homebrew。

git -C "$(brew --repo)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git

git -C "$(brew --repo homebrew/core)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git

git -C "$(brew --repo homebrew/cask)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask.git

brew update
————————————————
版权声明:本文为CSDN博主「YD-10-NG」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/sinat_38184748/article/details/99450330
git -C "$(brew --repo)" remote set-url origin https://github.com/Homebrew/brew.git

git -C "$(brew --repo homebrew/core)" remote set-url origin https://github.com/Homebrew/homebrew-core.git

git -C "$(brew --repo homebrew/cask)" remote set-url origin https://github.com/Homebrew/homebrew-cask.git

brew update
————————————————
版权声明:本文为CSDN博主「YD-10-NG」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/sinat_38184748/article/details/99450330cp config config.old

所以具体过程改成了:

cd /usr/local/Homebrew/
git remote set-url origin https://mirrors.ustc.edu.cn/brew.git
cd Library/Taps/homebrew/homebrew-core
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
cd ../homebrew-cask
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-cask.git
vi ~/.cshrc ## add the following line 
setenv HOMEBREW_BOTTLE_DOMAIN http://mirrors.ustc.edu.cn/homebrew-bottles

brew update
brew doctor # to check whether everything is OK. source ~/.cshrc

其实所有的配置文件在这些位置,名字是config:

/usr/local/Homebrew/.git
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/.git
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask/.git

 

macOS的Homebrew换国内源

原文:https://www.cnblogs.com/xhliu73/p/12270984.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!