远程连接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重新更新并重新安装扩展项。

  • 连接成功
相关推荐
北京盛世宏博1 小时前
边缘计算赋能!机房机柜微环境温湿度快速响应控制方案
运维·服务器·网络
淡水瑜1 小时前
Visual Studio 实操
ide·visual studio
油丶酸萝卜别吃2 小时前
堡垒机的集中管控具体体现在哪些方面?
服务器
真正的醒悟2 小时前
图解网络22
服务器·网络·php
爱打代码的小林3 小时前
python基础(pandas库)
服务器·python·pandas
学困昇4 小时前
Linux基础开发工具(下):调试器gdb/cgdb的使用详解
linux·运维·服务器·开发语言·c++
liulilittle4 小时前
Linux shell 搜索指定后缀名文件,并复制到指定目录。
linux·服务器·数据库
双翌视觉4 小时前
服务器电源外观检测智能化机器视觉解决方案
运维·服务器·人工智能·机器学习
Channing Lewis4 小时前
.ini文件格式
服务器
aduzhe5 小时前
vscode 自动化格式问题
ide·vscode·自动化