zoukankan      html  css  js  c++  java
  • brew 切换源

    中科大源

    # 替换brew.git:
    cd "$(brew --repo)"
    git remote set-url origin https://mirrors.ustc.edu.cn/brew.git
    
    # 替换homebrew-core.git:
    cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
    git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
    
    # 替换homebrew-cask.git:
    cd "$(brew --repo)/Library/Taps/homebrew/homebrew-cask"
    git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-cask.git
    
    # 应用生效
    brew update
    # 替换homebrew-bottles:
    echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.bash_profile
    source ~/.bash_profile
    

      

    切换回官方的

    # 替换brew.git:
    cd "$(brew --repo)"
    git remote set-url origin https://github.com/Homebrew/brew.git
    
    # 替换homebrew-core.git:
    cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
    git remote set-url origin https://github.com/Homebrew/homebrew-core.git
    
    # 替换homebrew-cask.git:
    cd "$(brew --repo)/Library/Taps/homebrew/homebrew-cask"
    git remote set-url origin https://github.com/Homebrew/homebrew-cask.git
    
    # 应用生效
    brew update
    
    # 删除.bash_profile变量
    vim  ~/.bash_profile
    # 删除如下变量
    # export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles
    
    # 执行更新
    source ~/.bash_profile
    

      

    切换成阿里源

    cd "$(brew --repo)"
     
    git remote set-url origin https://mirrors.aliyun.com/homebrew/brew.git
     
    cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
     
    git remote set-url origin https://mirrors.aliyun.com/homebrew/homebrew-core.git
     
    echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles' >> ~/.bash_profile
    source ~/.bash_profile
    

      

  • 相关阅读:
    用C# WebClient类 提交数据
    a标签弹出 文件上载框
    C中 #define
    五款专业文本编辑器比较(转贴)
    IE和Firefox(火狐)在JavaScript方面的不兼容及统一方法总结
    全球历史票房排行
    ASP调用带参数存储过程的几种方式
    VB6.0如何使用正则表达式
    实现VB与EXCEL的无缝连接
    初识Firebug 全文 — firebug的使用
  • 原文地址:https://www.cnblogs.com/rianley/p/13637378.html
Copyright © 2011-2022 走看看