zoukankan      html  css  js  c++  java
  • Homebrew修改源已经重置恢复

    替换中科大源

    替换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 Bottles源: 参考:替换Homebrew 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
    

    替换清华源 清华源设置参考

    替换现有上游

    # brew 程序本身,Homebrew/Linuxbrew 相同
    git -C "$(brew --repo)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git
    
    # 以下针对 mac OS 系统上的 Homebrew
    git -C "$(brew --repo homebrew/core)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
    git -C "$(brew --repo homebrew/cask)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask.git
    git -C "$(brew --repo homebrew/cask-fonts)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask-fonts.git
    git -C "$(brew --repo homebrew/cask-drivers)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask-drivers.git
    
    # 更换后测试工作是否正常
    brew update
    

    复原

    (感谢Snowonion Lee提供说明)

    # brew 程序本身,Homebrew/Linuxbrew 相同
    git -C "$(brew --repo)" remote set-url origin https://github.com/Homebrew/brew.git
    
    # 以下针对 mac OS 系统上的 Homebrew
    git -C "$(brew --repo homebrew/core)" remote set-url origin https://github.com/Homebrew/homebrew-core.git
    git -C "$(brew --repo homebrew/cask)" remote set-url origin https://github.com/Homebrew/homebrew-cask.git
    git -C "$(brew --repo homebrew/cask-fonts)" remote set-url origin https://github.com/Homebrew/homebrew-cask-fonts.git
    git -C "$(brew --repo homebrew/cask-drivers)" remote set-url origin https://github.com/Homebrew/homebrew-cask-drivers.git
    
    # 更换后测试工作是否正常
    brew update
    

    切换回官方源:

    重置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
    

    注释掉bash配置文件里的有关Homebrew Bottles即可恢复官方源。 重启bash或让bash重读配置文件。

    参考:

    [替换及重置Homebrew默认源](

  • 相关阅读:
    css3-10 如何使用滚动条
    jquery如何实现点击标题收缩下面的内容
    js 字符串操作函数有哪些
    好记性不如烂笔头85-spring3学习(6)-BeanFactory 于bean生命周期
    【电视桌面CSWUI】电视桌面(launcher)截图欣赏
    OR1200数据Cache运用情景分析
    Spring3.0学习笔记文档的官方网站(六)--3.4.1
    or1200乘法除法指令解释
    C++使用简单的函数指针
    jQuery表格排序总成-tablesorter
  • 原文地址:https://www.cnblogs.com/hongdada/p/12992682.html
Copyright © 2011-2022 走看看