V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
Vkin
V2EX  ›  macOS

home brew 突然 curl: (7) Failed to connect to 错误,谷歌了半天没找到答案。

  •  1
     
  •   Vkin · Apr 9, 2017 · 20115 views
    This topic created in 3305 days ago, the information mentioned may be changed or developed.
    电脑挂的 ss 全局代理,之前 home brew 完全使用正常, 3 月份的时候用 homebrew 安装了 charles ,然后导入了 charles 的 https 证书 到 mac 上。

    今天使用 home brew 安装软件, brew cask install keka 结果提示 curl: (7) Failed to connect to github-cloud.s3.amazonaws.com port 443: Operation timed out 。

    于是乎 brew doctor 检测问题,提示 Your system is ready to brew.
    brew update , brew upgrade. 均能正常更新使用

    然后开始谷歌,搜了各种方法都没用,最后看到这位作者的解决方法, http://www.itkeyword.com/doc/9020916023480990x231/brew%20install%20opencv 想到可能是 charles 的证书导致的,最后删除了 charles 的证书,按照他的方法添加了环境变量,再次 brew doctor 却提示:
    Please note that these warnings are just used to help the Homebrew maintainers
    with debugging if you file an issue. If everything you use Homebrew for is
    working fine: please don't worry and just ignore them. Thanks!

    Warning: SSL_CERT_DIR support was removed from Apple's curl.
    If fetching formulae fails you should:
    unset SSL_CERT_DIR
    and remove it from ~/.bash_profile if present.

    Warning: Setting SSL_CERT_FILE can break downloading files; if that happens
    you should unset it before running Homebrew.

    Homebrew uses the system curl which uses system certificates by
    default. Setting SSL_CERT_FILE makes it use an outdated OpenSSL, which
    does not support modern OpenSSL certificate stores.

    忽略后 brew cask install keka 提示:

    ==> Satisfying dependencies
    complete
    ==> Downloading https://github.com/aonez/Keka/releases/download/v1.0.8/Keka-1.0.
    Warning: ignoring SSL_CERT_DIR environment variable, not supported by libcurl


    心累,求大神帮忙看看
    22 replies    2017-04-11 11:50:32 +08:00
    faceair
        1
    faceair  
       Apr 9, 2017 via iPhone
    终端程序大部分不走系统代理,你可能需要想办法给 brew 挂上代理
    Vkin
        2
    Vkin  
    OP
       Apr 9, 2017
    @faceair 尝试了在 bash.profile 里面加上 全局代理,依然不行,另外我之前在 ss 开全局, brew 都能正常下载安装,刚才在终端 ping github.com 也可以 ping 通。
    iakisey
        3
    iakisey  
       Apr 9, 2017 via iPhone
    ping Google 试试,终端确实不走代理,上 proxychains4 试试?
    Vkin
        4
    Vkin  
    OP
       Apr 9, 2017
    @iakisey 谷歌竟然 ping 不通。。难不成之前能正常 brew 是因为之前 亚马逊云服务可以正常访问? 那我试试 proxychains4
    appppap
        5
    appppap  
       Apr 9, 2017 via iPhone
    给你的提议,千万不要重做 brew ,后果是你之前安装的软件可能会消失。
    iCyMind
        7
    iCyMind  
       Apr 9, 2017 via Android
    不仅 brew ,很多终端应用不走代理的,有得烦。在上级路由 fq ,不用管这些糟心事了。
    硬件路由不能 f ,可以试试用虚拟机接管本机流量。

    https://www.v2ex.com/t/319006#reply2
    Vkin
        8
    Vkin  
    OP
       Apr 10, 2017
    @appppap 差一点就重做 brew 了,多谢提醒!
    Vkin
        9
    Vkin  
    OP
       Apr 10, 2017
    @iakisey [由于 Mac 的 sip 保护,导致了 Proxychains 无法正常工作,残念。(OS X 10.11 版本以上都 GG) ] 这个你是怎么解决点的?有个方法说是要有配置 polipo....
    Vkin
        10
    Vkin  
    OP
       Apr 10, 2017
    @mritd 感谢,这个牛!
    Vkin
        11
    Vkin  
    OP
       Apr 10, 2017
    @iCyMind 闲下来时,折腾折腾。
    Shiweizhi
        12
    Shiweizhi  
       Apr 10, 2017 via iPhone
    Vkin
        13
    Vkin  
    OP
       Apr 10, 2017
    @iCyMind 刚才把路由器设置了全局代理,本机浏览器可以翻墙,查询 ip 地址也是路由器的翻墙 IP ,但是 ping google.com 依然 ping 不通,是怎么回事呃?
    Vkin
        14
    Vkin  
    OP
       Apr 10, 2017
    路由器翻墙搞定了, brew install ,待会试试 虚拟机跑流量。
    Chingim
        15
    Chingim  
       Apr 10, 2017
    ping 不通 google, 可能是因为解析到了一个假的 ip?
    ynyounuo
        16
    ynyounuo  
       Apr 10, 2017 via iPhone
    ping?
    你们认真的吗?
    tyfulcrum
        17
    tyfulcrum  
       Apr 10, 2017
    export https_proxy=http://uri:port;export http_proxy=http://uri:port
    终端挂代理用这个就好啦,不用那么复杂。
    iCyMind
        18
    iCyMind  
       Apr 10, 2017 via Android
    @tyfulcrum 有些应用就是不支持这个变量呀
    clavichord93
        19
    clavichord93  
       Apr 10, 2017 via iPhone
    你这肯定是没代理啊…
    Vkin
        20
    Vkin  
    OP
       Apr 10, 2017
    @clavichord93 我还以为是 charles 的 ssl 证书导致的,因为之前一直是可以正常使用...尴尬了,通过路由器翻墙解决了这个问题。
    Vkin
        21
    Vkin  
    OP
       Apr 10, 2017
    @Shiweizhi 这个解决失败,不知是什么原因。
    UntilPush
        22
    UntilPush  
       Apr 11, 2017
    @Vkin 我个人的问题:
    使用 ss , wget google.com 可以 curl google.com 就会出现同样的问题
    解决方式:
    vim ~/.curlrc
    socks5 = "127.0.0.1:1080"
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1498 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 51ms · UTC 23:59 · PVG 07:59 · LAX 16:59 · JFK 19:59
    ♥ Do have faith in what you're doing.