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

  • 连接成功
相关推荐
Y淑滢潇潇16 分钟前
RHCSA Linux 系统创建文件
linux·运维·服务器
XYN6121 分钟前
【嵌入式学习3】基于python的tcp客户端、服务器
服务器·开发语言·网络·笔记·python·学习·tcp/ip
the_nov24 分钟前
20.IP协议
linux·服务器·网络·c++·tcp/ip
一一代码29 分钟前
ide技术
ide·python
源代码•宸1 小时前
Visual Studio Code SSH 连接超时对策( keep SSH alive)
运维·服务器·ide·经验分享·vscode·ssh
zyx没烦恼2 小时前
Linux 下 日志系统搭建全攻略
linux·服务器·开发语言·c++
大橘3 小时前
centos8上实现lvs集群负载均衡dr模式
服务器·负载均衡·lvs
码上飞扬3 小时前
深入探索 Linux Top 命令:15 个实用示例
linux·运维·服务器
灰色人生qwer3 小时前
内网服务器centos7安装jdk17
java·运维·服务器
念心科道尊3 小时前
【Csharp】Winform客户端与服务器,局域网加密字符串与文件通信
运维·服务器·c#