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

  • 连接成功
相关推荐
麻瓜呀18 分钟前
vue2 Element-ui框架相关常见问题-表单组件重置显示异常
运维·服务器·ui
wanhengidc21 分钟前
算力服务器的作用都有哪些?
运维·服务器·深度学习
电商API_1800790524724 分钟前
京东商品评论API接口封装的心路历程
服务器·开发语言·爬虫·数据分析·php
你怎么知道我是队长28 分钟前
VsCode插件推荐---Todo Tree
ide·vscode·编辑器
benjiangliu43 分钟前
LINUX系统-12-进程控制(三)-自定义shell
linux·运维·服务器
becatjd1 小时前
VScode的claude code插件报错command ‘claude-vscode.editor.openLast‘ not found
ide·vscode·编辑器·claude·anthropic·claude code
my_styles1 小时前
window系统安装/配置Nginx
服务器·前端·spring boot·nginx
feathered-feathered1 小时前
测试实战【用例设计】自己写的项目+功能测试(1)
java·服务器·后端·功能测试·jmeter·单元测试·压力测试
BIBI20491 小时前
下载指定历史版本 VSCode 或 VSCode Insider
ide·vscode·编辑器
茶杯梦轩1 小时前
从零起步学习并发编程 || 第八章:线程池实战(避坑指南与最佳实践)
服务器·后端·面试