mac下如何安装homebrew
- 访问官网
- 执行命令
/bin/bash -c "$(curl -fsSL
- 执行完毕后存在警告,/opt/homebrew/bin is not in your PATH。此时无法直接在命令行执行brew命令。
Warning: /opt/homebrew/bin is not in your PATH.
Instructions on how to configure your shell for Homebrew
can be found in the 'Next steps' section below.
==> Installation successful!
==> Homebrew has enabled anonymous aggregate formulae and cask analytics.
Read the analytics documentation (and how to opt-out) here:
No analytics data has been sent yet (nor will any be during this install run).
==> Homebrew is run entirely by unpaid volunteers. Please consider donating:
==> Next steps:
- Run these three commands in your terminal to add Homebrew to your PATH:
echo '# Set PATH, MANPATH, etc., for Homebrew.' >> /Users/tanghonggang1/.zprofile
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/tanghonggang1/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
- Run brew help to get started
- Further documentation:
- 按照Next steps提示,执行三条命令
% echo '# Set PATH, MANPATH, etc., for Homebrew.' >> /Users/tanghonggang1/.zprofile
% echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/tanghonggang1/.zprofile
% eval "$(/opt/homebrew/bin/brew shellenv)"
- 验证是否成功安装 brew help
% brew help
Example usage:
brew search TEXT|/REGEX/
brew info [FORMULA|CASK...]
brew install FORMULA|CASK...
brew update
brew upgrade [FORMULA|CASK...]
brew uninstall FORMULA|CASK...
brew list [FORMULA|CASK...]
Troubleshooting:
brew config
brew doctor
brew install --verbose --debug FORMULA|CASK
Contributing:
brew create URL [--no-fetch]
brew edit [FORMULA|CASK...]
Further help:
brew commands
brew help [COMMAND]
man brew