Homebrew的安装及配置

中文文档地址https://brew.sh/index_zh-cn

 Homebrew是Mac OSX下使用的包管理工具,用来安装OSX系统中没有预装但是你需要的东西。它将软件包安装到独立目录,并在/usr/local目录下创建软链接。

安装Homebrew

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

 

解决 “curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused” 错误

 前往www.ipaddress.com网站查询raw.githubusercontent.com主机的真实IP:199.232.68.133

 

命令行

sudo vim /etc/hosts

修改/etc/hosts文件,添加以下内容:

199.232.68.133  raw.githubusercontent.com

 

然后在重新执行上面的安装命令

使用 阿里云 的 Homebrew 镜像源进行加速。

假设你没有更换过镜像源,执行 brew 命令安装应用的时候,下面3 个仓库地址将影响你的下载速度:brew.git、homebrew-core.git、homebrew-bottles。

首先,更换 brew.git

cd "$(brew --repo)"
git remote set-url origin https://mirrors.aliyun.com/homebrew/brew.git

然后更换 homebrew-core.git 

cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.aliyun.com/homebrew/homebrew-core.git

随后,运行brew config 来检查一下地址是否更新成功

更新一下源

brew update

最后更换 homebrew-bottles 

echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles' >> ~/.bash_profile
source ~/.bash_profile

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

无物勿吾

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值