brew详解

作者: 闲睡猫 | 来源:发表于2019-02-21 05:23 被阅读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

    相关文章

      网友评论

        本文标题:brew详解

        本文链接:https://www.haomeiwen.com/subject/irslyqtx.html