V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Vkin
V2EX  ›  macOS

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

  •  1
     
  •   Vkin · 2017-04-09 22:19:34 +08:00 · 19445 次点击
    这是一个创建于 2545 天前的主题,其中的信息可能已经有所发展或是发生改变。
    电脑挂的 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 条回复    2017-04-11 11:50:32 +08:00
    faceair
        1
    faceair  
       2017-04-09 22:51:35 +08:00 via iPhone
    终端程序大部分不走系统代理,你可能需要想办法给 brew 挂上代理
    Vkin
        2
    Vkin  
    OP
       2017-04-09 23:22:57 +08:00
    @faceair 尝试了在 bash.profile 里面加上 全局代理,依然不行,另外我之前在 ss 开全局, brew 都能正常下载安装,刚才在终端 ping github.com 也可以 ping 通。
    iakisey
        3
    iakisey  
       2017-04-09 23:28:33 +08:00 via iPhone
    ping Google 试试,终端确实不走代理,上 proxychains4 试试?
    Vkin
        4
    Vkin  
    OP
       2017-04-09 23:49:45 +08:00
    @iakisey 谷歌竟然 ping 不通。。难不成之前能正常 brew 是因为之前 亚马逊云服务可以正常访问? 那我试试 proxychains4
    appppap
        5
    appppap  
       2017-04-09 23:55:07 +08:00 via iPhone
    给你的提议,千万不要重做 brew ,后果是你之前安装的软件可能会消失。
    iCyMind
        7
    iCyMind  
       2017-04-09 23:58:08 +08:00 via Android
    不仅 brew ,很多终端应用不走代理的,有得烦。在上级路由 fq ,不用管这些糟心事了。
    硬件路由不能 f ,可以试试用虚拟机接管本机流量。

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