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

  • 连接成功
相关推荐
清清&3 分钟前
【Linux】冯诺依曼体系结构和操作系统的理解
linux·运维·服务器
蜡笔大新79833 分钟前
IDEA中的异常
java·ide·intellij-idea
HalvmånEver1 小时前
Linux:基础开发工具(三)
linux·运维·服务器·开发语言·学习·gcc/g++
阿巴~阿巴~1 小时前
UDP服务端绑定INADDR_ANY后,客户端该用什么IP访问?
服务器·网络·udp协议·网络测试·udp套接字编程·inaddr_any
wanhengidc2 小时前
巨 椰 云手机稳定挂机 搬砖
运维·服务器·游戏·智能手机·云计算
小龙报2 小时前
《VScode搭建教程(附安装包)--- 开启你的编程之旅》
c语言·c++·ide·vscode·单片机·物联网·编辑器
木易 士心2 小时前
Android Studio + Gemini 移动开发领域的一次范式转移
android·ide·android studio
洛克大航海3 小时前
PyCharm 软件关联 GitHub 账户
ide·pycharm·github
橘子真甜~3 小时前
C/C++ Linux网络编程4 - 解决TCP服务器并发的方式
linux·运维·服务器
last demo3 小时前
Linux 逻辑卷管理
linux·运维·服务器