brew 常见问题解决
2021-01-26 本文已影响0人
孙毛毛丶
1.如何让brew每次执行前不要自动更新
export HOMEBREW_NO_AUTO_UPDATE=true
或者直接配置 讲上面的命令插入 ~/.bash_profile
生效 source ~/.bash_profile
如果安装了 zsh可以装到 ~/.zshrc 中
2.brew 常用命令
brew config # 查看现在镜像源
brew search formula # 搜索软件包
brew install formula # 安装软件包
brew remove formula # 移除软件包
brew cleanup formula # 清除旧包
brew list # 列出已安装的软件包
brew update # 更新 Homebrew
brew upgrade # 升级软件包
brew home formula # 用浏览器打开
brew info formula # 显示软件内容信息
brew deps formula # 显示包的依赖
brew server # 启动 web 服务器,可以通过浏览器访问 http://localhost:4567 来通过网页来管理包
brew -h # 帮助
brew versions formula # 列出软件包的版本
brew services list 列出所有再运行的程序
3.brew update 出错解决
出错:
fatal: could not read Username for 'https://github.com': terminal prompts disabled
fatal: could not read Username for 'https://github.com': terminal prompts disabled
fatal: could not read Username for 'https://github.com': terminal prompts disabled
解决方法
brew tap
>会出现
caskroom/cask
denisidoro/tools
homebrew/cask
homebrew/core
homebrew/php
homebrew/science
homebrew/services
homebrew/versions
只要替换就可以
brew untap homebrew/php
brew untap caskroom/cask
brew untap denisidoro/tools
...
其他 引用连接
解决MacBook安装Homebrew超时更新慢的问题,从此告别龟速更新
5.新出现的brew update错误
目录在
➜ homebrew-core git:(master) brew update
error: cannot open .git/FETCH_HEAD: Permission denied
image.png
pwd 一下
/usr/local/Homebrew/Library/Taps/homebrew
解决方法:
sudo chown -R $(whoami) /usr/local/Homebrew/Library/Taps
brew update
image.png