zoukankan      html  css  js  c++  java
  • homebrew更新源

    brew 安装软件比较方便,国内源下载会比较快,但是有时下载会失败

    所有有时需要切换国内与默认的源

    切换国内源

    # 替换brew.git:
    $ cd "$(brew --repo)"
    # 中国科大:
    $ git remote set-url origin https://mirrors.ustc.edu.cn/brew.git
    # 清华大学:
    $ git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/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
    # 清华大学:
    $ git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
    
    # 替换homebrew-bottles:
    # 中国科大:
    $ echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.bash_profile
    $ source ~/.bash_profile
    # 清华大学:
    $ echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles' >> ~/.bash_profile
    $ source ~/.bash_profile
    
    # 应用生效:
    $ 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_profile 中把带有homebrew的配置项注释后尝试

  • 相关阅读:
    WCF添加服务失败。服务元数据可能无法访问。请确保服务正在运行并且正在公开元数据。
    【C#】 实现WinForm中只能启动一个实例
    centos7防火墙问题
    ftp搭建记录
    centos7常用命令
    RocketMQ部署
    mongedb主从
    redis 主从复制+读写分离+哨兵
    keepalive+nginx
    分布架构分析
  • 原文地址:https://www.cnblogs.com/a531248552/p/13344177.html
Copyright © 2011-2022 走看看