您的位置:首页 > 其它

mac 安装brew及设置国内镜像

2017-04-29 00:00 537 查看
摘要: mac下安装各种软件,brew是个不二之选,极力推荐使用

推荐镜像源

Coding
推出了Brew国内镜像源,速度挺快的。

$ cd /usr/local && git remote set-url origin https://git.coding.net/homebrew/homebrew.git $ cd $home && brew update


我是用以下方法设置的,在~/.bash_profile中添加以下代码

export HOMEBREW_BOTTLE_DOMAIN=https://git.coding.net/homebrew/homebrew.git


其它镜像

cd /usr/local
//清华镜像源
git remote set-url origin git://mirrors.tuna.tsinghua.edu.cn/homebrew.git
//中科大镜像源
git remote set-url origin http://mirrors.ustc.edu.cn/homebrew.git //三者选其一即可更新

如果速度还是很慢,可以尝试以下操作:

cd ~/tmp
//以下两个选一个(要与你之前选择的镜像源相同)
git clone git://mirrors.tuna.tsinghua.edu.cn/homebrew.git
git clone http://mirrors.ustc.edu.cn/homebrew.git 
rm -rf /usr/local/.git
rm -rf /usr/local/Library
cp -R homebrew/.git /usr/local/
cp -R homebrew/Library /usr/local/

然后重试
brew update
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息