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

  • 连接成功
相关推荐
盘古开天16661 小时前
如何用废弃电脑变成服务器搭建web网站(公网访问零成本)
服务器·电脑·免费公网ip
xuanzdhc4 小时前
Linux 基础IO
linux·运维·服务器
bantinghy4 小时前
Linux进程单例模式运行
linux·服务器·单例模式
AWS官方合作商9 天前
AWS ACM 重磅上线:公有 SSL/TLS 证书现可导出,突破 AWS 边界! (突出新功能的重要性和突破性)
服务器·https·ssl·aws
算法练习生9 天前
Linux文件元信息完全指南:权限、链接与时间属性
linux·运维·服务器
忘了ʷºᵇₐ9 天前
Linux系统能ping通ip但无法ping通域名的解决方法
linux·服务器·tcp/ip
成遇9 天前
在Vscode中安装Sass并配置
vscode·rust·sass
weixin_425023009 天前
Spring Boot使用MCP服务器
服务器·spring boot·后端·spring ai·mcp
API开发9 天前
苹果芯片macOS安装版Homebrew(亲测) ,一键安装node、python、vscode等,比绿色软件还干净、无污染
vscode·python·docker·nodejs·openssl·brew·homebrew
qq_200337399 天前
python输出值,写入test.yaml文件
java·服务器·前端