1、brew update 卡死问题
卡死的问题,我是参考的下面这篇文章
https://blog.csdn.net/evane1890/article/details/108795717
(1)
#更新Homebrew
cd "$(brew --repo)"
git remote set-url origin https://mirrors.ustc.edu.cn/brew.git
#更新Homebrew-core
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
#更新Homebrew-cask(最重要的一步,很多更新完国内源依然卡就是没更新这个)
cd "$(brew --repo)"/Library/Taps/homebrew/homebrew-cask
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-cask.git
ps:如果没有homebrew-cask这个目录可以找到/usr/local/Library……下的相关目录自己创建一个即可。
(2)
zsh用户
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles/' >> ~/.zshrc
source ~/.zshrc
bash用户
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles/' >> ~/.bash_profile
source ~/.bash_profile
(3)更新一下
brew update -v
or
brew update-reset
2、brew install 总是显示No similarly named formulae found.问题
git -C $(brew --repository homebrew/core) checkout master
or
git -C $(brew --repository homebrew/core) reset --hard HEAD.