zoukankan      html  css  js  c++  java
  • 解决Homebrew下载更新极慢的问题

    https://www.jianshu.com/p/055832c19148

    由于问题主要是在国内网络环境github下载慢,因此尝试:

    更换使用国内的homebrew镜像源;

    使用代理访问github.com

    更换Homebrew源

    使用以下命令更换国内阿里云上的homebrew镜像:

    # 替换brew.git:

    cd "$(brew --repo)"
    
    git remote set-url origin https://mirrors.aliyun.com/homebrew/brew.git

    # 替换homebrew-core.git:

    cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
    
    git remote set-url origin https://mirrors.aliyun.com/homebrew/homebrew-core.git

    # 替换homebrew-bottles:

    echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles' >> ~/.zshrc
    
    source ~/.zshrc

    替换后,问题依旧,继续查看日志:

    可以看到由于homebrew-cask的仓库依然指向了Github,这个过程还是慢。阿里云的镜像站没有提供homebrew-cask,进一步搜索找到USTC镜像站,该站提供了homebrew-cask的源。使用上述同样的命令更换源:

    # 替换homebrew-cask.git:

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

    测试发现问题解决。

  • 相关阅读:
    栈及练习
    约瑟夫问题
    双向链表
    链表
    线性表
    高级排序
    建议16:比较函数调用模式
    建议15:推荐动态调用函数
    建议14:灵活使用Arguments
    建议13:禁用Function构造函数
  • 原文地址:https://www.cnblogs.com/chenzeyong/p/12152795.html
Copyright © 2011-2022 走看看