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

  • 连接成功
相关推荐
木子欢儿6 小时前
Intel 架构的 MacBook Pro 运行 Linux 发热量高解决
linux·运维·服务器
清水迎朝阳8 小时前
客户端软件 — 用户统计方案
服务器·c++·客户端·用户统计
会编程的土豆9 小时前
Go 模板初识
linux·运维·服务器
腾讯蓝鲸智云9 小时前
标杆客户实践提炼:CFlow 版本价值流模板实战指南
运维·服务器·自动化·云计算·devops
阿标的博客9 小时前
Active Directory 组织单位和用户
服务器
Deryck_德瑞克10 小时前
【Nginx】配置差异分析
服务器·前端·nginx
前端 贾公子10 小时前
第06章:结构化输出 (上)
java·服务器·前端
regret~10 小时前
【记录】网络路由、转发与网卡隔离
linux·服务器·网络
一只小菜鸡..11 小时前
南京大学 操作系统 (JYY) 学习笔记:持久化的黑魔法——从磁铁、刻坑到闪存电荷
服务器·笔记·学习
翼龙云_cloud11 小时前
腾讯云国际站代理商: COS 对象存储 + CDN加速 从创建到加速完成
运维·服务器·云计算·腾讯云