新mac本安装Homebrew姿势(大前提:需要FQ)

1、背景:

  一开始直接按照homebrew官网https://brew.sh的步骤安装失败

fatal: unable to access 'https://github.com/Homebrew/brew/': LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 60

2、解决方法:

  2.1、先卸载干净安装失败的homebrew包

git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow

  2.2、查看网络设置里当前网络socks代理服务器的IP和端口号,如下截图

  2.3、添加gitconfig全局配置

cat ~/.gitconfig

  查看是否有如下两项配置:

http.proxy=socks5://127.0.0.1:1089
http.sslbackend=openssl

  如果没有,在终端分别运行如下两条命令添加配置:

git config --global http.sslBackend "openssl"
git config --global http.proxy "socks5://127.0.0.1:1089" // 端口号请使用自己本地socks端口号

  再查看gitconfig的配置,就有如下截图中的配置项了

  2.4、重新安装homebrew

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

3、如果安装成功后想卸载上述2.3gitconfig的全局配置

git config --global --unset  http.sslBackend
git config --global --unset http.proxy
原文地址:https://www.cnblogs.com/elevens/p/15258272.html