IT@程序员猿媛效率工具箱

brew详解

2019-02-21  本文已影响14人  闲睡猫

brew官网

安装brew:

$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

更换国内源

$ cd "$(brew --repo)"
$ git remote set-url origin git://mirrors.ustc.edu.cn/brew.git
$ cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
$ git remote set-url origin git://mirrors.ustc.edu.cn/homebrew-core.git

默认不安装cask 有需要的可以替换

$ cd "/usr/local/Homebrew/Library/Taps/caskroom/homebrew-cask"
$ git remote set-url origin git://mirrors.ustc.edu.cn/homebrew-cask.git

更新brew

brew update

替换bintray镜像,在你的bash配置文件后加上:export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles, 以zsh为例:

$ echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.zshrc
$ source ~/.zshrc

操作命令

通过 brew 可以查看命令列表

$ brew
Example usage:
  brew search [TEXT|/REGEX/]
  brew info [FORMULA...]
  brew install FORMULA...
  brew update
  brew upgrade [FORMULA...]
  brew uninstall FORMULA...
  brew list [FORMULA...]

管理服务

brew services 查看基本用法

image
上一篇下一篇

猜你喜欢

热点阅读