Mac Homebrew超坑爹的地方
安裝失敗
開始在終端里使用官網(wǎng)的安裝腳本:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
==> Downloading and installing Homebrew... fatal: unable to access 'https://github.com/Homebrew/brew/': SSL: no alternative certificate subject name matches target host name 'github.com' Failed during: git fetch origin --force
此時我ping github.com是能ping通的!
解決問題
開始百度
網(wǎng)上都說下載brew的安裝腳本到本地
curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install >> brew_install
然后找到brew_install文件,然后將
BREW_REPO="https://github.com/Homebrew/brew”.freeze
替換為
BREW_REPO=“https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git”.freeze
然而
我下載的brew_install文件卻是這樣的
#!/usr/bin/ruby STDERR.print <<EOS Warning: The Ruby Homebrew installer is now deprecated and has been rewritten in Bash. Please migrate to the following command: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" EOS Kernel.exec "/bin/bash", "-c", '/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"'
根本就沒有BREW_REPO
于是開啟了漫長的各種解決方案,都無功而返。
偶然間靈機一動,把從官網(wǎng)下載下來的brew_install文件仔細讀了一下,發(fā)現(xiàn)里面有句/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
curl應該是獲取對應url資源的。于是我貼chorme里看了下!!
發(fā)現(xiàn)了新大陸!
如上圖,就是brew_install文件里邊的內容!
于是我再按照網(wǎng)上說的那種流程走,把里邊的內容全部復制到brew_install里邊去;
并且
終端terminal里運行
!!搞定!!
將
BREW_REPO="https://github.com/Homebrew/brew"替換為BREW_REPO="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git"終端terminal里運行
/bin/bash ./brew_install!!搞定!!
最后執(zhí)行
brew update或者愛干哈干哈去啦!

浙公網(wǎng)安備 33010602011771號