美文网首页
mac下安装brew遇到的几个小坑

mac下安装brew遇到的几个小坑

作者: kevinfaith | 来源:发表于2020-02-29 22:54 被阅读0次

    简介

    brew 全称Homebrew 是Mac OSX上的软件包管理工具,拥有安装、卸载、更新、查看、搜索等很多实用的功能。简单的一条指令,就可以实现包管理,而不用你关心各种依赖和文件路径的情况,十分方便快捷。类似于ubuntu里面的apt,centos里面的yum。

    安装方式

    安装方式就不多做介绍了,就一条命令

    • 安装

         /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
      
    • 卸载

        /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"  
      
    • 简单实用

        安装软件:brew install 软件名,例:brew install wget
        搜索软件:brew search 软件名,例:brew search wget
        卸载软件:brew uninstall 软件名,例:brew uninstall wget
        更新所有软件:brew update
      
        更新具体软件:brew upgrade 软件名 
        显示已安装软件:brew list
        显示包依赖:brew reps
        显示帮助:brew help
      

    接下来回归正题,例举几个遇到的坑:

    报错

    1、443报错:

        Failed to connect to raw.githubusercontent.com port:443
    

    解决方法:

        sudo vi /etc/hosts  #末尾添加:
        192.30.253.113  github.com
        192.30.252.131  github.com
        185.31.16.185   github.global.ssl.fastly.net
        74.125.237.1    dl-ssl.google.com
        173.194.127.200 groups.google.com
        192.30.252.131  github.com
        185.31.16.185   github.global.ssl.fastly.net
        74.125.128.95   ajax.googleapis.com
    

    2、RPC failed错误:

        RPC failed; curl 18 transfer closed with outstanding read data remain
    

    解决方法

    百度多数的解决方式都是这样

        git config --global http.postBuffer 524288000
    

    这句命令的大致意思就是把git的上传下载文件的大小上限调大,改成500M。

    但是结果本人多次尝试都是失败,然后仔细研究发现,我们是通过https的,你把curl的http协议的postBuffer调大了毫无用处。
    so:

        git config --global https.postBuffer 524288000
    

    完美解决!!

    另在提一个小技巧:
    如果你没有代理的话,可以使用手机热点下载,成功率会高很多,具体原理我也没弄清,不知道是玄学还是。。但是经过本人的测试,确实有用!

    相关文章

      网友评论

          本文标题:mac下安装brew遇到的几个小坑

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