近日在自己電腦上brew install xxxx 的時候,發現自動更新homebrew時,卡住很長時間都沒有進行下去 。
通過 brew update --verbose , 發現卡在了homebrew-cask 更新上。在這之前將homebrew源由github 更新成了阿里雲鏡像的源,經過確認才發現,阿里雲鏡像站中只有brew-core 沒有brew-cask 。 而此時,將homebrew-cask 的源替換成中科大的也沒用。同樣會卡住。索性全部替換成中科大的源:
// 替換brew.git: cd "$(brew --repo)" git remote set-url origin https://mirrors.ustc.edu.cn/brew.git // 替換homebrew-core.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
再次brew update ,順利更新成功。
halberd:homebrew-cask halberd$ brew update --verbose Checking if we need to fetch /usr/local/Homebrew... Checking if we need to fetch /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask... Fetching /usr/local/Homebrew... Checking if we need to fetch /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core... Fetching /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask... Fetching /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core... remote: Counting objects: 2032, done. remote: Compressing objects: 100% (542/542), done. remote: Total 2032 (delta 1510), reused 2008 (delta 1490) Receiving objects: 100% (2032/2032), 779.51 KiB | 322.00 KiB/s, done. Resolving deltas: 100% (1510/1510), completed with 464 local objects. From https://mirrors.ustc.edu.cn/homebrew-core 3ec0e6d65d..7f57a7247b master -> origin/master remote: Counting objects: 38587, done. remote: Compressing objects: 100% (15839/15839), done. remote: Total 38587 (delta 28331), reused 32948 (delta 22748) Receiving objects: 100% (38587/38587), 30.13 MiB | 1.68 MiB/s, done. Resolving deltas: 100% (28331/28331), completed with 1706 local objects. From https://mirrors.ustc.edu.cn/homebrew-cask da61b406f4..edb591d620 master -> origin/master remote: Counting objects: 413, done. remote: Compressing objects: 100% (157/157), done. remote: Total 413 (delta 315), reused 333 (delta 238) Receiving objects: 100% (413/413), 54.07 KiB | 1.10 MiB/s, done. Resolving deltas: 100% (315/315), completed with 158 local objects. ........... Updating /usr/local/Homebrew... ............ Updating /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask... .......... ==> Homebrew has enabled anonymous aggregate formulae and cask analytics. Read the analytics documentation (and how to opt-out) here: https://docs.brew.sh/Analytics No analytics have been recorded yet (or will be during this `brew` run). git config --replace-all homebrew.analyticsmessage true git config --replace-all homebrew.caskanalyticsmessage true Updated 2 taps (homebrew/core and homebrew/cask). ==> New Formulae ........... 內容實在太長,略掉吧