美文网首页
国内镜像安装Homebrew

国内镜像安装Homebrew

作者: 是瓜瓜呀 | 来源:发表于2018-04-03 16:48 被阅读0次

官方安装

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


国内镜像安装
  • 获取brew_install文件
    curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install >> brew_install
  • 编辑brew_install文件
#BREW_REPO = "https://github.com/Homebrew/brew".freeze
BREW_REPO = "git://mirrors.ustc.edu.cn/brew.git".freeze
  • 安装brew
    /usr/bin/ruby ./brew_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 "$(brew --repo)/Library/Taps/homebrew/homebrew-cask"
    git remote set-url origin git://mirrors.ustc.edu.cn/homebrew-cask.git

  • brew 更新
    brew update

  • 替换bintray镜像
    echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.bash_profile
    source ~/.bash_profile


相关文章

网友评论

      本文标题:国内镜像安装Homebrew

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