首页 > 系统服务 > 详细

mac安装brew

时间:2020-04-04 20:21:58      阅读:65      评论:0      收藏:0      [点我收藏+]

1.第一步,获取install文件
把官网给的脚本拿下来

curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install >> brew_install

2.第二步,更改脚本中的资源链接,替换成清华大学的镜像
就是把这两句
BREW_REPO = “https://github.com/Homebrew/brew“.freeze
CORE_TAP_REPO = “https://github.com/Homebrew/homebrew-core“.freeze
更改为这两句
BREW_REPO = “https://mirrors.ustc.edu.cn/brew.git “.freeze
CORE_TAP_REPO = “https://mirrors.ustc.edu.cn/homebrew-core.git“.freeze
当然如果这个镜像有问题的话,可以换成别的

3.第三步,执行脚本
/usr/bin/ruby brew_install

更换国内镜像源:

执行下面这句命令,更换为中科院的镜像:

git clone git://mirrors.ustc.edu.cn/homebrew-core.git/ /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core --depth=1

就下载成功了

然后把homebrew-core的镜像地址也设为中科院的国内镜像

cd "$(brew --repo)"

git remote set-url origin https://mirrors.ustc.edu.cn/brew.git

cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"

git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git

执行更新,成功:

brew update

mac安装brew

原文:https://www.cnblogs.com/c-x-a/p/12633689.html

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