如果您经常使用brew命令行工具,则必须注意,每次执行安装配方的命令时,该工具都会执行更新,本文教您禁用Homebrew自动更新的方法。参考在Linux下安装Homebrew(Linuxbrew)的方法。
具体方法 请参阅下面的示例来安装ranger formula: $ brew install ranger Updating Homebrew... ==> Auto-updated Homebrew! Updated 2 taps (homebrew/core and homebrew/cask). ==> Updated Casks browserosaurus ==> Downloading https://ranger.github.io/ranger-1.9.3.t .... 要在每次运行brew命令时阻止此更新,请将1传递给HOMEBREW_NO_AUTO_UPDATE环境变量: HOMEBREW_NO_AUTO_UPDATE=1 brew install <formula> 这是一次操作,要使其成为永久配置,请根据您使用的shell在.bashrc或.zshrc文件中设置变量: --- Bash --- $ vim ~/.bashrc export HOMEBREW_NO_AUTO_UPDATE=1 --- Zsh --- $ vim ~/.zshrc export HOMEBREW_NO_AUTO_UPDATE=1 获取shell程序配置文件: $ source ~/.bashrc or source ~/.zshrc 现在尝试安装以确认设置有效: $ brew install iproute2mac ==> Downloading https://github.com/brona/iproute2mac/releases/download/v1.2.3/iproute2mac-1.2.3.tar.gz Already downloaded: /Users/jkmutai/Library/Caches/Homebrew/downloads/fdb133eaa8f1346a259295ba9aa22ab56....--iproute2mac-1.2.3.tar.gz /usr/local/Cellar/iproute2mac/1.2.3: 6 files, 22.5KB, built in 2 seconds 我们可以确认,没有尝试更新。
相关主题 |