macOS的Homebrew的mirror配置

相似ubuntu下面的apt-get或者centos的yum,Mac下也有相似的包管理工具。名字叫Homebrewgit

Homebrew安裝方式:github

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

使用起來就很簡單:chrome

安裝ubuntu

brew install your_package_name

卸載centos

brew uninstall your_package_name

可是好比安裝chrome或者iTerm就用Homebrew就不行了,這裏有個工具叫Homebrew Caskruby

Homebrew Cask安裝方式:bash

brew tap caskroom/cask

安裝app

brew cask install your_application

總所周知的緣由,咱們爲了更好的食用,須要配置一下加速的mirrorcurl

這裏推薦食用的是utsc mirror工具

  1. 替換Homebrew默認源

    cd "$(brew --repo)"
    git remote set-url origin git://mirrors.ustc.edu.cn/brew.git
  2. 替換Core源

    cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
    git remote set-url origin git://mirrors.ustc.edu.cn/homebrew-core.git
  3. 替換Bottles二進制源

    bash

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

    zsh

    echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.zshrc
    source ~/.zshrc
  4. 替換Cask源

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

    cd "$(brew --repo)/Library/Taps/caskroom/homebrew-cask
    git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-cask.git
相關文章
相關標籤/搜索