1、brew update 卡死问题
(1)依次替换以下brew源
#更新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或bash用户,执行即可
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
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.
3. Mac报错:Error: The following directories are not writable by your user: /usr/local/share/man/man8 解决方案
首先打开终端,然后输入:
sudo chown -R `whoami`:admin /usr/local/bin
接着系统会提醒你输入密码,输入密码回车之后接着输入:
sudo chown -R `whoami`:admin /usr/local/share
之后就能在终端中用brew install 安装文件了
ps:如果还是报错的话,将3的命令中 /usr/local 后的目录换成报错的目录,再次执行即可。