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

  • 连接成功
相关推荐
识途老码15 分钟前
什么是单臂路由
运维·服务器·网络·单臂路由
Linux运维老纪34 分钟前
Ansible 铸就 Linux 安全之盾(Ansible Builds Linux Security Shield)
linux·服务器·网络·安全·云计算·ansible·运维开发
PassLink_1 小时前
[Jupyter Notebook]:Jupyter Notebook 安装教程(代码编辑器)
ide·jupyter·编辑器·环境变量·python 安装·notebook 安装教程
YuSun_WK2 小时前
程序&进程&多任务&线程
linux·运维·服务器
HeLLo_a1193 小时前
第11章 安全网络架构和组件(一)
linux·服务器·网络
南川琼语3 小时前
TCP概念+模拟tcp服务器及客户端
linux·服务器·网络·tcp/ip
潘yi.8 小时前
web技术与nginx网站环境部署
服务器·网络·nginx
安顾里8 小时前
Linux命令-iostat
linux·运维·服务器
whoarethenext8 小时前
初始https附带c/c++源码使用curl库调用
服务器·c++·qt·https·curl
100编程朱老师9 小时前
面试:什么叫Linux多路复用 ?
linux·运维·服务器