安装
终端运行
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
安装完成后,会自动替换镜像源,解决下载慢的问题。
❯ brew config
HOMEBREW_VERSION: 3.2.1-70-g5659d74
ORIGIN: https://mirrors.ustc.edu.cn/brew.git
HEAD: 5659d74ff59414d22e285d77a7fcfcd3c1bf0614
Last commit: 12 days ago
Core tap ORIGIN: https://mirrors.ustc.edu.cn/homebrew-core.git
Core tap HEAD: 311debb8863de7ec52e6df91cfffb218e854a3c0
Core tap last commit: 11 days ago
Core tap branch: master
HOMEBREW_PREFIX: /usr/local
HOMEBREW_BOTTLE_DOMAIN: https://mirrors.ustc.edu.cn/homebrew-bottles/bottles
HOMEBREW_CASK_OPTS: []
HOMEBREW_MAKE_JOBS: 12
Homebrew Ruby: 2.6.3 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
CPU: dodeca-core 64-bit kabylake
Clang: 12.0.5 build 1205
Git: 2.32.0 => /usr/local/bin/git
Curl: 7.64.1 => /usr/bin/curl
macOS: 11.4-x86_64
CLT: 12.5.1.0.1.1623191612
Xcode: N/A
使用
❯ brew
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
Reference
[1] brew
man-page (command documentation)
[2] 【2021.1.21更新】Mac安装Homebrew慢,解决办法
[3] Homebrew国内如何自动安装(国内地址)