← 返回卷宗
編程筆記

MAC上Brew被牆的更新

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"


指令安裝時提示github無法訪問,下載不了brew。 所以只能

git clone git://mirrors.tuna.tsinghua.edu.cn/homebrew.git 或(git clone http://mirrors.ustc.edu.cn/homebrew.git)


下載,然後拷入/usr/local文件夾 在嘗試

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

後,


進行 brew update時,仍然提示無法訪問 github,很是怪異。


想到辦法有兩種,一種是去修改 brew 的腳本強行指定,但太麻煩了。 所以最終還是用shadowsocksx-ng,直接通過連上服務器,開1087端口作為http代理,並在終端中使用:

export https_proxy=http://127.0.0.1:1087


然後brew成功。

本文由 三符道長 撰於 2016年12月17日。轉載請註明出處。