mac安裝brew

命令行安裝

對于brew的安裝,只要一條命令就可以了

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

安裝慢或443問題

由于安裝源在github上,國內訪問github有名種蛋疼的問題。

通過https://www.ipaddress.com先查出raw.githubusercontent.com的真實ip,然后修改本地hosts文件添加直接解析

:: 由于它是通過CDN的,可能不止一個ip,挑一個自己訪問最快的ip解析就可以了,ip之后也可能會改變。
185.199.108.133 raw.githubusercontent.com
185.199.108.133 user-images.githubusercontent.com
185.199.108.133 avatars2.githubusercontent.com
185.199.108.133 avatars1.githubusercontent.com

然后再運行上面的命令安裝brew。

自己安裝了好幾次都卡在了homebrew-core下載上,有時是下不過來,有時直接報錯了。

Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core'...
fatal: unable to access 'https://github.com/Homebrew/homebrew-core/': LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 54
Error: Failure while executing; `git clone https://github.com/Homebrew/homebrew-core /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core` exited with 128.
Error: Failure while executing; `/usr/local/bin/brew tap homebrew/core` exited with 1.

這個,直接進入github網站https://github.com/Homebrew/homebrew-core,點擊直接下載zip包。

然后把整個zip包解壓,復制到/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core目錄下。

最后診斷一下

brew doctor
brew -v
最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容