Search code examples
linuxcentosredhatrpm

How to run visual studio code in linux


I am new to Linux OS, I downloaded rpm package from of visual studio code from Microsoft official website.This is the machine

CentOS Linux release 7.6.1810 (Core)

I ran the command

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 <vscode-linux@microsoft.com>
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.

Now I want to run the visual studio code as I run in windows machine. How do I achieve this?

Note I have only ssh connection to the linux machine.


Solution

  • you should start by installing the package. You only just queried the package, to install it, you must (as super user) run:

    rpm --install code-1.40.2-1574694258.el7.x86_64.rpm
    

    once that is installed, you'll be able to launch the program by launching the command:

    code
    

    As @Leon.fon noted, if you have only an ssh connection, you won't be able to start a GUI, but exporting your display might work:

    ssh -X ...