zoukankan      html  css  js  c++  java
  • mac下 brew 切换阿里镜像

    每次brew安装新包的时候必先更新自身,网络慢的时候brew update无限卡死,虽然按一次ctrl C可以跳过,但有时候恰恰是brew本身版本导致的莫名其妙的问题出现,如果不把航空母舰更新了,后面也不会顺利。

    今天一怒之下,换了阿里镜像,果然一切迎刃而解了(原教派)

    贴上iterm-bash脚本备查:

    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

    前两步实际上就是去/usr/local/Homebrew目录下把brew和brew-core的git路径给换了,最后一步是二进制源需要修改bashprofile文件改变量。

    完后再执行一次brew update,是不是神清气爽?

  • 相关阅读:
    三元表达式
    迭代器
    python字符串内的自建函数 string.
    shell下的while和if
    正则表达
    nginx下同时做负载均衡和web服务
    nfs匹配nginx服务
    yum安装nginx的负载均衡详解
    samba实战讲解
    python基础之数据类型
  • 原文地址:https://www.cnblogs.com/NetKillWill/p/brew.html
Copyright © 2011-2022 走看看