Homebrew基本操作
2019-12-21 本文已影响0人
Cynric
一、命令行安装
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
二、替换清华源
替换现有上游
git -C "$(brew --repo)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git
git -C "$(brew --repo homebrew/core)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
git -C "$(brew --repo homebrew/cask)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask.git
brew update
复原
git -C "$(brew --repo)" remote set-url origin https://github.com/Homebrew/brew.git
git -C "$(brew --repo homebrew/core)" remote set-url origin https://github.com/Homebrew/homebrew-core.git
git -C "$(brew --repo homebrew/cask)" remote set-url origin https://github.com/Homebrew/homebrew-cask.git
brew update
三、常用命令
brew命令:
| 分类 | 命令 | 说明 |
|---|---|---|
| Example usage | brew search [TEXT|/REGEX/] | |
| brew info [FORMULA...] | ||
| brew install FORMULA... | ||
| brew update | ||
| brew upgrade [FORMULA...] | ||
| brew uninstall FORMULA... | ||
| brew list [FORMULA...] | ||
| Troubleshooting | brew config | 输出各组件版本、配置信息及源信息 |
| brew doctor | ||
| brew install --verbose --debug FORMULA | ||
| Contributing | brew create [URL [--no-fetch]] | 创建FORMULA |
| brew edit [FORMULA...] | 编辑FORMULA | |
| Further help | brew commands | 输出brew所有命令关键字 |
| brew help [COMMAND] | 查看某个command的说明 | |
| man brew | 查看brew man手册 | |
| https://docs.brew.sh | 官网文档 |
四、卸载Homebrew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"