我是Linux操作系统的新手,我从Microsoft官方网站的Visual Studio代码中下载了rpm软件包。这是机器
CentOS Linux release 7.6.1810 (Core)
我运行了命令
rpm -qpi code-1.40.2-1574694258.el7.x86_64.rpm
Output of the command
Name : code
Version : 1.40.2
Release : 1574694258.el7
Architecture: x86_64
Install Date: (not installed)
Group : Development/Tools
Size : 235084185
License : Multiple, see https://code.visualstudio.com/license
Signature : (none)
Source RPM : code-1.40.2-1574694258.el7.src.rpm
Build Date : Mon 25 Nov 2019 10:04:31 AM EST
Build Host : 2114565cfb42
Relocations : (not relocatable)
Packager : Visual Studio Code Team <[email protected]>
Vendor : Microsoft Corporation
URL : https://code.visualstudio.com/
Summary : Code editing. Redefined.
Description :
Visual Studio Code is a new choice of tool that combines the simplicity of a code editor with what developers need for the core edit-build-debug cycle. See https://code.visualstudio.com/docs/setup/linux for installation instructions and FAQ.
现在,我想像在Windows计算机中一样运行Visual Studio代码。我该如何实现?
注意,我只有ssh与Linux机器的连接。
您应先安装软件包。您只需查询软件包,要安装它,您必须(以超级用户身份)运行:
rpm --install code-1.40.2-1574694258.el7.x86_64.rpm
一旦安装,您将可以通过启动命令来启动程序:
code
正如@ Leon.fon所指出的,如果只有ssh
连接,则将无法启动GUI,但是导出显示可能会起作用:
ssh -X ...
VSCode是基于gui的工具。如果只有ssh acces,则可以尝试通过x11 forwarding运行它,或设置VNC connection来远程控制另一台计算机。但是正如Leon.fon提到的那样,ssh通常基于命令行。
您无法通过ssh运行它,您需要在Linux shell上方有一些GUI。您只能使用命令行编辑器,例如; “ nano”,“ vim”等。
编辑:
或者,您可以在本地计算机上运行VScode,并通过ssh将其连接到远程计算机。https://code.visualstudio.com/docs/remote/ssh