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

  • 连接成功
相关推荐
严谨的麻辣烫9 小时前
2026 年静态 IP 为什么重新受到关注?从住宅代理安全问题看固定网络出口
运维·服务器·tcp/ip·网络安全
treacle田9 小时前
达梦数据库-Linux DM数据守护主备集群缩改为单机-记录总结
linux·服务器·数据库·主备集群改单机
shengchanxian19 小时前
2026年9月服务器装配流水线厂家技术测评:对标国标的硬件评判逻辑
运维·服务器·服务器装配流水线厂家
IT大白鼠10 小时前
CentOS 7.9 自建 Yum 源服务器搭建指南
linux·服务器·centos
LaughingZhu10 小时前
Product Hunt 每日热榜 | 2026-09-02
java·ide·intellij-idea
cuijiecheng201811 小时前
从 GinormoTime 到 Rocky Linux:25fps LTC 完整搭建与验证实战
linux·运维·服务器
进击的蜗牛Eric11 小时前
VSCode Server手动安装指南(简洁版)
vscode
凤舞飘伶12 小时前
服务器内存满日常运维命令
linux·运维·服务器
IPdodo_12 小时前
静态 IP 访问异常排查:403/429 归因与迁移验收
服务器·网络·数据库·python·网络协议·php·性能测试
小芒果_0113 小时前
从0到1,将pycharm上的项目上传到github
ide·pycharm·github