Homebrew 是 OS X 下的包管理工具,类似 CentOS 的 yum ,Ubuntu 的 apt-get 。在 OS X 命令行下,可以通过 brew 和 brew cask 命令安装应用。
1. 安装 brew cask
1
|
brew install brew-cask-completion
|
2. brew 和 brew cask 区别
brew
与 brew cask
的区别在于偏向的应用类型。brew 更偏向于开发人员,主要安装命令行工具;brew cask 偏向日常用户,主要安装图形界面应用。在使用方法上,两者没有太大差别,基本上使用 brew cask
替换 brew
即可,详细请查看 help。
3. brew 增删改查
1
|
brew uninstall <AppName>
|
6. brew 更换源
1
2
3
4
5
6
7
8
9
|
cd "$(brew --repo)"
git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git
1. git remote set-url origin https://github.com/Homebrew/brew.git
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
1. git remote set-url origin https://github.com/Homebrew/homebrew-core
brew update
|