1.如何讓brew每次執(zhí)行前不要自動(dòng)更新
export HOMEBREW_NO_AUTO_UPDATE=true
或者直接配置 講上面的命令插入 ~/.bash_profile
生效 source ~/.bash_profile
如果安裝了 zsh可以裝到 ~/.zshrc 中
2.brew 常用命令
brew config # 查看現(xiàn)在鏡像源
brew search formula # 搜索軟件包
brew install formula # 安裝軟件包
brew remove formula # 移除軟件包
brew cleanup formula # 清除舊包
brew list # 列出已安裝的軟件包
brew update # 更新 Homebrew
brew upgrade # 升級(jí)軟件包
brew home formula # 用瀏覽器打開(kāi)
brew info formula # 顯示軟件內(nèi)容信息
brew deps formula # 顯示包的依賴(lài)
brew server # 啟動(dòng) web 服務(wù)器,可以通過(guò)瀏覽器訪(fǎng)問(wèn) http://localhost:4567 來(lái)通過(guò)網(wǎng)頁(yè)來(lái)管理包
brew -h # 幫助
brew versions formula # 列出軟件包的版本
brew services list 列出所有再運(yùn)行的程序
3.brew update 出錯(cuò)解決
出錯(cuò):
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
>會(huì)出現(xiàn)
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超時(shí)更新慢的問(wèn)題,從此告別龜速更新
5.新出現(xiàn)的brew update錯(cuò)誤
目錄在
? 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