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

Ubuntu系统下Snap安装的VS Code因低速网络无法下载扩展的解决方法咨询

Fixing VS Code Extension Download Timeouts in Iran

Hey Mehdi, sorry to hear you're hitting those frustrating XHR timeout errors when trying to install VS Code extensions—network restrictions and slow speeds can be a real pain. Let's walk through a few practical solutions that should help you get your extensions installed successfully:

1. Manually Download & Install Extensions via VSIX Files

This is the most reliable workaround when direct market access is spotty:

  • Open VS Code, go to the Extensions panel, find the extension you want, and copy its unique ID (it looks like publisher.extension-name, e.g., ms-python.python—you can find this under the extension's name on its details page).
  • Download the extension's VSIX file (the offline installation package). You can get this by searching for the extension's name plus "VS Code VSIX download", or by using the official marketplace's download option if you can access it briefly.
  • Back in VS Code, open the Command Palette with Ctrl+Shift+P, type Install from VSIX, select the downloaded file, and follow the prompts to install.

2. Configure VS Code to Use a Proxy

If you have access to a reliable proxy server, setting it up in VS Code can bypass network slowdowns:

  • Open VS Code Settings with Ctrl+, (or go to File > Preferences > Settings).
  • Search for Http: Proxy and enter your proxy server address (e.g., http://your-proxy-ip:port).
  • Search for Http: Proxy Strict SSL and toggle it to false (this helps if your proxy uses a self-signed certificate).
  • Restart VS Code and try downloading extensions again.

3. Switch from Snap to APT Installed VS Code

Snap packages sometimes have network isolation quirks that can worsen timeout issues. Try switching to the APT version:

  • First uninstall the Snap version:
    sudo snap remove code
    
  • Add the official VS Code APT repository and install it via:
    sudo apt update && sudo apt install code
    
  • The APT version often has better network compatibility for extension downloads.

4. Install Extensions via the Terminal

Using VS Code's command-line tool can sometimes handle network retries better than the GUI:

  • First, make sure the code command is available in your terminal (it should be if you have VS Code installed correctly).
  • Copy the extension ID (same as step 1), then run:
    code --install-extension <your-extension-id>
    
  • If you're using a proxy, set the proxy environment variables first:
    export http_proxy=http://your-proxy-ip:port
    export https_proxy=http://your-proxy-ip:port
    code --install-extension <your-extension-id>
    

Hope one of these methods gets you up and running with your extensions! Let me know if you need clarification on any step.

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.04.27 13:38:15