近日在自己電腦上brew install xxxx 的時候,發(fā)現(xiàn)自動更新homebrew時,卡住很長時間都沒有進行下去 。
通過 brew update --verbose , 發(fā)現(xiàn)卡在了homebrew-cask 更新上。在這之前將homebrew源由github 更新成了阿里云鏡像的源,經(jīng)過確認才發(fā)現(xiàn),阿里云鏡像站中只有brew-core 沒有brew-cask 。 而此時,將homebrew-cask 的源替換成中科大的也沒用。同樣會卡住。索性全部替換成中科大的源:
[
](javascript:void(0); "復制代碼")
<pre style="margin-top: 0px; margin-bottom: 0px; white-space: pre-wrap; overflow-wrap: break-word; border: 1px solid rgb(85, 85, 85); background: rgb(238, 238, 238); font-size: 12px !important; padding: 1em; font-family: "Courier New" !important;">// 替換brew.git:
cd "(brew --repo)/Library/Taps/homebrew/homebrew-core" git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git // 替換homebrew-cask.git:
cd "$(brew --repo)"/Library/Taps/homebrew/homebrew-cask
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-cask.git</pre>
轉(zhuǎn)載于https://www.cnblogs.com/halberd-lee/p/12500338.html