記錄vscode連接不上wsl子系統下ubuntu18.04問題解決方法

記錄vscode連接不上wsl子系統下ubuntu18.04問題解決方法

    • 報錯內容
    • 嘗試第一次解決方法
    • 嘗試第二次解決方法
    • 注意事項
    • 參考連接

報錯內容

Unable to download server on client side: Error: Request downloadRequest failed unexpectedly without providing any details… Will try to download on WSL side. vscode
–2025-04-07 16:33:04-- https://update.code.visualstudio.com/commit:4437686ffebaf200fa4a6e6e67f735f3edf24ada/server-linux-legacy-x64/stable
[2025-04-07 08:33:05.151] Resolving update.code.visualstudio.com (update.code.visualstudio.com)… 13.107.246.50, 2620:1ec:bdf::50
[2025-04-07 08:33:05.151] Connecting to update.code.visualstudio.com (update.code.visualstudio.com)|13.107.246.50|:443… connected.
[2025-04-07 08:33:05.436] HTTP request sent, awaiting response… 404 Not Found
[2025-04-07 08:33:05.436] 2025-04-07 16:33:05 ERROR 404: Not Found.
[2025-04-07 08:33:05.436]
[2025-04-07 08:33:05.436] ERROR: Failed to download https://update.code.visualstudio.com/commit:4437686ffebaf200fa4a6e6e67f735f3edf24ada/server-linux-legacy-x64/stable to /home/zl/.vscode-server/bin/4437686ffebaf200fa4a6e6e67f735f3edf24ada-1744014784.tar.gz

嘗試第一次解決方法

  1. 升級wsl 未能解決
  2. 回退vscode版本 未能解決
  3. 重啟計算機 未能解決
  4. 刪除服務器目錄并重新連接
rm -rf ~/.vscode-server

此步解決了上面的報錯,又出現新的報錯,如下:
/home/zl/.vscode-server/bin/4437686ffebaf200fa4a6e6e67f735f3edf24ada/node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28’ not found (required by /home/zl/.vscode-server/bin/4437686ffebaf200fa4a6e6e67f735f3edf24ada/node)

嘗試第二次解決方法

mkdir ~/src
cd ~/srcwget 'https://ftp.gnu.org/gnu/glibc/glibc-2.28.tar.gz'
tar xzf glibc-2.28.tar.gzmkdir glibc-2.28-build
cd glibc-2.28-build
../glibc-2.28/configure --prefix=/opt/glibc-2.28make# make sure you can write to /opt/glibc-2.28
make install

其中遇到使用prefix命令修改指定編譯目錄出錯,報錯如下:

../configure --prefix=/opt/glibc-2.28/
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for gcc... gcc
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for readelf... readelf
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking whether g++ can link programs... yes
checking for sysdeps preconfigure fragments... aarch64 alpha arm hppa i386 m68k microblaze mips nios2 powerpc riscv s390 sh sparc x86_64 checking whether gcc compiles in -mx32 mode by default... nochecking for use of fpu sysdeps directories... yes
checking for -fstack-protector... yes
checking for -fstack-protector-strong... yes
checking for -fstack-protector-all... yes
checking for assembler and linker STT_GNU_IFUNC support... yes
checking for gcc attribute ifunc support... yes
checking if compiler warns about alias for function with incompatible types... no
checking sysdep dirs... sysdeps/unix/sysv/linux/x86_64/64 sysdeps/unix/sysv/linux/x86_64 sysdeps/unix/sysv/linux/x86 sysdeps/x86/nptl sysdeps/unix/sysv/linux/wordsize-64 sysdeps/x86_64/nptl sysdeps/unix/sysv/linux sysdeps/nptl sysdeps/pthread sysdeps/gnu sysdeps/unix/inet sysdeps/unix/sysv sysdeps/unix/x86_64 sysdeps/unix sysdeps/posix sysdeps/x86_64/64 sysdeps/x86_64/fpu/multiarch sysdeps/x86_64/fpu sysdeps/x86/fpu sysdeps/x86_64/multiarch sysdeps/x86_64 sysdeps/x86 sysdeps/ieee754/float128 sysdeps/ieee754/ldbl-96 sysdeps/ieee754/dbl-64/wordsize-64 sysdeps/ieee754/dbl-64 sysdeps/ieee754/flt-32 sysdeps/wordsize-64 sysdeps/ieee754 sysdeps/generic
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln -s works... yes
checking whether as is GNU as... yes
checking whether ld is GNU ld... yes
checking for as... as
checking version of as... 2.30, ok
checking for ld... ld
checking version of ld... 2.30, ok
checking for gnumake... no
checking for gmake... no
checking for make... make
checking version of make... 4.1, ok
checking for gnumsgfmt... no
checking for gmsgfmt... no
checking for msgfmt... msgfmt
checking version of msgfmt... 0.19.8.1, ok
checking for makeinfo... no
checking for sed... sed
checking version of sed... 4.4, ok
checking for gawk... gawk
checking version of gawk... 4.1.4, ok
checking for bison... no
checking if gcc is sufficient to build libc... yes
checking for nm... nm
checking for python3... python3
configure: error:
*** These critical programs are missing or too old: bison
*** Check the INSTALL file for required versions. 

看報錯日志是編譯glibc-2.28時出現的bison缺失或版本過舊的問題,于是

sudo apt-get update
sudo apt-get install bison

安裝bison后再次執行

../configure --prefix=/opt/glibc-2.28/

成功修改編譯指定編譯目錄。

安裝"patchelf"

sudo apt-get update
sudo apt-get install patchelf
cd ~/.vscode-server/bin/4437686ffebaf200fa4a6e6e67f735f3edf24ada
cp node node_bak
patchelf --set-interpreter /opt/glibc-2.28/lib/ld-linux-x86-64.so.2 --set-rpath /opt/glibc-2.28/lib:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu node

至此glibc-2.28安裝及鏈接到新安裝的glibc-2.28完成,vscode可以正常連接到wsl擴展中的ubuntu18.04。

注意事項

編譯并覆蓋安裝glibc會導致系統崩潰,編譯的時候一定要指定prefix,千萬不能把系統中原有的lib給覆蓋了。

參考連接

https://github.com/microsoft/vscode/issues/210033

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/pingmian/76134.shtml
繁體地址,請注明出處:http://hk.pswp.cn/pingmian/76134.shtml
英文地址,請注明出處:http://en.pswp.cn/pingmian/76134.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

Cursor+MCP學習記錄

參考視頻 Cursor MCP 王炸!徹底顛覆我的Cursor工作流,效率直接起飛_嗶哩嗶哩_bilibili 感覺這個博主講的還不錯 所使用到的網址 Smithery - Model Context Protocol Registry Introduction - Model Context Protocol 學習過程 Smithery - Model …

testflight上架ipa包-只有ipa包的情況下如何修改簽名信息為蘋果開發者賬戶對應的信息-ipa蘋果包如何手動改簽或者第三方工具改簽-優雅草卓伊凡

testflight上架ipa包-只有ipa包的情況下如何修改簽名信息為蘋果開發者賬戶對應的信息-ipa蘋果包如何手動改簽或者第三方工具改簽-優雅草卓伊凡 直接修改蘋果IPA包的簽名和打包信息并不是一個推薦的常規做法,因為這可能違反蘋果的開發者條款,并且可能導致…

深入解析Java內存與緩存:從原理到實踐優化

一、Java內存管理:JVM的核心機制 1. JVM內存模型全景圖 ┌───────────────────────────────┐ │ JVM Memory │ ├─────────────┬─────────────────┤ │ Thread │ 共享…

紫光展銳5G SoC T8300:影像升級,「定格」美好世界

影像能力已成為當今衡量智能手機性能的重要標尺之一。隨著消費者對手機攝影需求日益提升,手機廠商紛紛在影像硬件和算法上展開激烈競爭,力求為用戶帶來更加出色的拍攝體驗。 紫光展銳專為全球主流用戶打造的暢享影音和游戲體驗的5G SoC——T8300&#x…

【Java設計模式】第6章 抽象工廠模式講解

6. 抽象工廠模式 6.1 抽象工廠講解 定義:提供一個接口創建一系列相關或依賴對象,無需指定具體類。核心概念: 產品等級結構:同一類型的不同產品(如Java視頻、Python視頻)。產品族:同一工廠生產的多個產品(如Java視頻 + Java手記)。適用場景: 需要創建多個相關聯的產品…

Dify教程01-Dify是什么、應用場景、如何安裝

Dify教程01-Dify是什么、應用場景、如何安裝 大家好,我是星哥,上篇文章講了Coze、Dify、FastGPT、MaxKB 對比,今天就來學習如何搭建Dify。 Dify是什么 **Dify 是一款開源的大語言模型(LLM) 應用開發平臺。**它融合了后端即服務&#xff08…

Java后端開發-面試總結(集結版)

第一個問題,在 Java 集合框架中,ArrayList和LinkedList有什么區別?在實際應用場景中,應該如何選擇使用它們? ArrayList 基于數組,LinkedList 基于雙向鏈表。 在查詢方面 ArrayList 效率高,添加…

nslookup、dig、traceroute、ping 這些工具在解析域名時是否查詢 DNS 服務器 或 本地 hosts 文件 的詳細對比

host配置解析 127.0.0.1 example.comdig 測試,查詢 DNS 服務器 nslookup測試,查詢 DNS 服務器 traceroute測試,先讀取本地 hosts 文件,再查詢 DNS 服務器 ping測試,先讀取本地 hosts 文件,再查詢 DNS 服務…

文件上傳、讀取與包含漏洞解析及防御實戰

一、漏洞概述 文件上傳、讀取和包含漏洞是Web安全中常見的高危風險點,攻擊者可通過此類漏洞執行惡意代碼、竊取敏感數據或直接控制服務器。其核心成因在于開發者未對用戶輸入內容進行充分驗證或過濾,導致攻擊者能夠繞過安全機制,上傳或執行…

STM32 的編程方式總結

🧱 按照“是否可獨立工作”來分: 庫/方式是否可獨立使用是否依賴其他庫說明寄存器裸寫? 是? 無完全自主控制,無庫依賴標準庫(StdPeriph)? 是? 只依賴 CMSIS自成體系(F1專屬),只…

Flutter命令行打包打不出ipa報錯

Flutter打包ipa報錯解決方案 在Flutter開發中,打包iOS應用時可能會遇到以下錯誤: error: exportArchive: The data couldn’t be read because it isn’ in the correct format. 或者 Encountered error while creating the IPA: error: exportArchive…

SQL Server常見問題的分類解析(一)

以下是SQL Server常見問題的分類解析,涵蓋安裝配置、性能優化、備份恢復、高可用性等核心場景,結合微軟官方文檔和社區實踐整理而成(編號對應搜索結果來源): 一、安裝與配置問題 安裝失敗:.NET Framework缺失解決方案:手動安裝所需版本.NET Framework,以管理員身份運行…

Spring Boot 3.x 下 Spring Security 的執行流程、核心類和原理詳解,結合用戶描述的關鍵點展開說明,并以表格總結

以下是 Spring Boot 3.x 下 Spring Security 的執行流程、核心類和原理詳解,結合用戶描述的關鍵點展開說明,并以表格總結: 1. Spring Security 核心原理 Spring Security 通過 Filter 鏈 實現安全控制,其核心流程如下&#xff1a…

Vue:路由切換表格塌陷

目錄 一、 出現場景二、 解決方案 一、 出現場景 當路由切換時&#xff0c;表格操作欄會出現行錯亂、塌陷的問題 二、 解決方案 在組件重新被激活的時候刷新表格 <el-table ref"table"></el-table>activated(){this.$nextTick(() > {this.$refs[t…

文件上傳漏洞原理學習

什么是文件上傳漏洞 文件上傳漏洞是指用戶上傳了一個可執行的腳本文件&#xff0c;并通過此腳本文件獲得了執行服務器端命令的能力。“文件上傳” 本身沒有問題&#xff0c;有問題的是文件上傳后&#xff0c;服務器怎么處理、解釋文件。如果服務器的處理邏輯做的不夠安全&#…

leetcode_數組 189. 輪轉數組

189. 輪轉數組 給定一個整數數組 nums&#xff0c;將數組中的元素向右輪轉 k 個位置&#xff0c;其中 k 是非負數 示例 1: 輸入: nums [1,2,3,4,5,6,7], k 3輸出: [5,6,7,1,2,3,4] 示例 2: 輸入&#xff1a;nums [-1,-100,3,99], k 2輸出&#xff1a;[3,99,-1,-100] 思…

天元證券|空倉一個月 這批新基金沖進去了!

多只一個月都按兵不動的次新基金&#xff0c;終于在4月7日沖進去了。 券商中國記者注意到&#xff0c;多只在3月初成立的新基金產品&#xff0c;在保持一個月凈值零波動之后&#xff0c;終于在4月7日建倉了。多只新基金產品當日凈值出現約1%至2%的波動幅度&#xff0c;參考4月7…

centos7系統搭建nagios監控

~監控節點安裝 1. 系統準備 1.1 更新系統并安裝依賴 sudo yum install -y httpd php php-cli gcc glibc glibc-common gd gd-devel make net-snmp openssl-devel wget unzip sudo yum install -y epel-release # 安裝 EPEL 倉庫 sudo yum install -y automake autoconf lib…

3. git config

文章目錄 基本概述配置級別基本用法設置配置項查看配置項刪除配置項 常用配置項 基本概述 git config 的作用是&#xff1a;設置用戶信息、編輯器、別名、倉庫行為等。 配置級別 級別作用范圍配置文件路徑命令選項倉庫級別&#xff08;Local&#xff09;當前倉庫.git/config…

WHAT - React 組件的 props.children 屬性

目錄 一、什么是 children二、基本用法三、類型定義&#xff08;TypeScript&#xff09;四、一些高級用法1. 條件渲染 children2. 多個 children 插槽&#xff08;命名插槽&#xff09; 五、children 的優勢總結 在 React 中&#xff0c;children 是一個非常重要且特殊的 內置屬…