美文网首页
Homebrew,你TM快點行不行

Homebrew,你TM快點行不行

作者: Cha0res | 来源:发表于2016-09-10 20:17 被阅读0次

    如果已經安裝過brew,可以重新安裝brew

    #卸載brew
    ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
    
    #安裝brew
    ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
    

    确保自己有/usr/local目录的权限,如果没有,可以使用如下指令

    sudo chown -R 你的用户名 /usr/local/
    

    更換鏡像源

    cd /usr/local
    #清华镜像源
    git remote set-url origin git://mirrors.tuna.tsinghua.edu.cn/homebrew.git
    #中科大镜像源
    git remote set-url origin http://mirrors.ustc.edu.cn/homebrew.git
    #Coding源
    git remote set-url origin https://git.coding.net/homebrew/homebrew.git
    #三者选其一即可更新
    

    如果以上指令报错,提示
    fatal: Not a git repository (or any of the parent directories): .git
    可以通过如下指令解决

    git init
    git remote add origin http://mirrors.ustc.edu.cn/homebrew.git
    

    設置Homebrew Bottles源,編輯~/.bashrc~/.zshrc添加

    export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles
    

    來自:Homebrew Bottle Mirror

    相关文章

      网友评论

          本文标题:Homebrew,你TM快點行不行

          本文链接:https://www.haomeiwen.com/subject/iwnyettx.html