远程连接VScode到云服务器 ECS

  • 在本地VScode上Enter SSH Connection Command: ssh -p portid username@ip

此处我出现了无法连接远程扩展主机服务器的错误,我试图在远程服务器手动安装code:

  • 在VScode官网上下载了Linux版本的code_1.91.1-1720564633_amd64.deb
  • 使用scp将文件传到了远程服务器scp C:\Downloads\code_1.91.1-1720564633_amd64.deb username@ip:"/home/"
  • 在文件路径中输入sudo dpkg - i code...,这是Debian包管理器,用于安装卸载配置等。

此处我又出现了报错:

cpp 复制代码
dpkg: error processing package code (--install):
 dependency problems - leaving unconfigured
Processing triggers for shared-mime-info (2.1-2) ...
Errors were encountered while processing:

有一系列依赖问题,我用apt来安装试图解决,apt通常比dpkg更智能:

cpp 复制代码
sudo apt update
sudo apt install ./code_1.91.1-1720564633_amd64.deb

仍然遇到一些错误:

cpp 复制代码
        Depends: xdg-utils (>= 1.0.2) but it is not installed
        Recommends: libvulkan1 but it is not installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

它让我使用apt --fix-broken install来解决:

cpp 复制代码
sudo apt --fix-broken install

VScode已安装。

再次远程连接,仍会出现无法连接的错误,这里发现本地的VScode的扩展项有问题,因此将本地VScode重新更新并重新安装扩展项。

  • 连接成功
相关推荐
chenyuhao20242 小时前
Linux系统编程:线程概念与控制
linux·服务器·开发语言·c++·后端
琢瑜2 小时前
VS Code 最下面那一整条蓝色状态栏不见了怎么恢复(Status Bar)状态栏(Status Bar)
vscode
prettyxian2 小时前
【linux】进程概念(1)PCB、系统调用与 proc 目录全解析
linux·运维·服务器
YJlio2 小时前
Streams 学习笔记(12.2):看见 NTFS 隐藏的备用数据流(ADS)
服务器·笔记·学习
bkspiderx2 小时前
Visual Studio 2026安装常见问题与解决方案
ide·visual studio·vs2026·vc2026安装
霜雪i2 小时前
Linux MD5
linux·服务器
小尧嵌入式3 小时前
Linux进程线程与进程间通信
linux·运维·服务器·c语言·开发语言·数据结构·microsoft
写代码的【黑咖啡】3 小时前
Python 中的控制流程:掌握程序的逻辑跳转
服务器·javascript·python
博语小屋3 小时前
Linux 地址转换函数详解
linux·运维·服务器·c++
bkspiderx3 小时前
Visual Studio 2026 安装指南(2025年最新状态+通用流程)
ide·安装·visual studio·vs2026