mac下如何安装homebrew

mac下如何安装homebrew

  1. 访问官网 https://brew.sh/;
  2. 执行命令
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  1. 执行完毕后存在警告,/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:
  https://docs.brew.sh/Analytics
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:
  https://github.com/Homebrew/brew#donations

==> 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:
    https://docs.brew.sh
  1. 按照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)"
  1. 验证是否成功安装 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
  https://docs.brew.sh

你可能感兴趣的:(Mac,macos,bash,开发语言)