mac安装brew遇到的问题
2021-08-17 15:08
1.问题:卡在更新上
maming@maming-PC ~ % brew install tree
Updating Homebrew…
解决:暂时关闭更新
export HOMEBREW_NO_AUTO_UPDATE=true
2.问题:安装时间比较久
解决:暂时替换为国内源
export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles
3.问题:安装时报错权限问题
maming@maming-PC ~ % brew install tree -d
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/tree.rb
Error: The following directories are not writable by your user:
/usr/local/share/man/man8
You should change the ownership of these directories to your user.
sudo chown -R $(whoami) /usr/local/share/man/man8
And make sure that your user has write permission.
chmod u+w /usr/local/share/man/man8
Error: Kernel.exit
/usr/local/Homebrew/Library/Homebrew/install.rb:76:in `exit'
/usr/local/Homebrew/Library/Homebrew/install.rb:76:in `diagnostic_checks'
/usr/local/Homebrew/Library/Homebrew/install.rb:52:in `perform_preinstall_checks'
/usr/local/Homebrew/Library/Homebrew/cmd/install.rb:257:in `install'
/usr/local/Homebrew/Library/Homebrew/brew.rb:110:in `<main>'
maming@maming-PC ~ % sudo brew install tree -d
解决: 按照上述提示设置权限
sudo chown -R $(whoami) /usr/local/share/man/man8
chmod u+w /usr/local/share/man/man8
4.问题: 安装好后,tree中文内容显示乱码
解决:
tree -N
参考:
https://www.cnblogs.com/coderxx/p/11337396.html
https://www.jianshu.com/p/7cb05a2b39a5