homebrew 的安装以及可能遇到的问题
1. install
官网只有一条命令:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
==在国内可能会遇到这样的问题:==
curl: (7) Failed to connect to raw.githubusercontent.com port 443: Operation timed out
这是因为网络的问题, raw.githubusercontent.com
访问不稳定
2. 解决办法
打开
shell
,然后输入下面一行命令,设置代理export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7891
这里的端口号需要看代理软件开启的端口号,比如clashX
设置
git
的代理git config --global https.proxy http://127.0.0.1:7890
git config --global http.proxy http://127.0.0.1:7890
再执行官网的命令
在下载完成之后,可能会提示
/opt/homebrew/bin is not in your path
此时,会提示看
next step
,运行提示的命令就可以了,比如: