You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Ubuntu终端执行flutter doctor命令失败,报curl握手错误

Fixing "curl: (35) gnutls_handshake() failed" Error When Running flutter doctor on Ubuntu

Hey there, I’ve dealt with this exact headache when setting up Flutter on Ubuntu—total roadblock, I know. Let’s walk through the most reliable fixes to get flutter doctor working again:

  • Update system packages and reinstall GnuTLS components
    Outdated GnuTLS libraries are a common culprit here. Run these commands to refresh your system and fix any corrupted or old packages:

    sudo apt update && sudo apt upgrade -y
    sudo apt install --reinstall gnutls-bin libgnutls30
    

    After this, try running flutter doctor again to see if the error clears up.

  • Switch curl to use OpenSSL instead of GnuTLS
    Ubuntu’s default curl uses GnuTLS, which can sometimes have handshake issues with certain servers. Let’s swap it to OpenSSL:

    1. Install the OpenSSL-backed curl package:
      sudo apt install curl-openssl
      
    2. Set it as the default curl version:
      sudo update-alternatives --config curl
      
      When prompted, select the option for curl-openssl (it’ll have a path like /usr/bin/curl-openssl).
  • Disable proxy settings temporarily
    If you’re using a system or environment proxy, it might be interfering with the TLS handshake. Try unsetting proxy variables first:

    unset http_proxy https_proxy
    

    If you have a GUI proxy enabled, head to Settings > Network > Proxy and toggle it off temporarily, then run flutter doctor again.

  • Manually install the Flutter SDK
    If all else fails, skip the curl-based installation entirely:

    1. Download the latest Flutter SDK zip from the official site (you can use your browser for this).
    2. Extract it to a directory like ~/development/flutter (create the folder if it doesn’t exist).
    3. Add Flutter’s bin directory to your PATH:
      echo 'export PATH="$PATH:$HOME/development/flutter/bin"' >> ~/.bashrc
      # If you use Zsh, replace .bashrc with .zshrc
      
    4. Reload your shell configuration:
      source ~/.bashrc
      

    Now run flutter doctor—it should work without relying on curl for the setup.

内容的提问来源于stack exchange,提问作者Natarajan R

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.20 10:08:49