How to install Visual Studio Code in CentOS

To install Visual Studio Code in Centos

Visual Studio Code is a free, code-optimized editor based on electron. It is known for its features Such as navigation, syntax highlighting, bracket matching, auto indentation, intellisense support and snippets. It supports various language. It integrates with the package managers and repositories. Installation of Visual Studio Code is explained in this manual.

To install Visual Studio Code

Create a directory inside the tmp directory, by using the following command.

[root@linuxhelp1 ~]# mkdir /tmp/vscode
[root@linuxhelp1 ~]# cd /tmp/vscode/


Download the visual studio code by using the following command.

[root@linuxhelp1 vscode]# wget https://az764295.vo.msecnd.net/public/0.3.0/VSCode-linux-x64.zip 
--2016-09-18 00:44:59-- https://az764295.vo.msecnd.net/public/0.3.0/VSCode-linux-x64.zip
Resolving az764295.vo.msecnd.net (az764295.vo.msecnd.net)... 68.232.45.201, 2606:2800:10c:1ff2:1d06:94b:c0f:14d
Connecting to az764295.vo.msecnd.net (az764295.vo.msecnd.net)|68.232.45.201|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 64992671 (62M) [application/octet-stream]
Saving to: ‘ VSCode-linux-x64.zip’ 

100%[=================================================================================================> ] 6,49,92,671 145KB/s in 5m 44s

2016-09-18 00:50:44 (185 KB/s) - ‘ VSCode-linux-x64.zip’  saved [64992671/64992671]


Run the following command to extract the downloaded package.

[root@linuxhelp1 vscode]# unzip VSCode-linux-x64.zip -d /opt/ 
Archive: VSCode-linux-x64.zip
creating: /opt/VSCode-linux-x64/
inflating: /opt/VSCode-linux-x64/libgcrypt.so.11
inflating: /opt/VSCode-linux-x64/libffmpegsumo.so
inflating: /opt/VSCode-linux-x64/license.txt
inflating: /opt/VSCode-linux-x64/icudtl.dat
creating: /opt/VSCode-linux-x64/resources/
creating: /opt/VSCode-linux-x64/resources/app/
inflating: /opt/VSCode-linux-x64/resources/app/nls.js

.
.
.
inflating: /opt/VSCode-linux-x64/natives_blob.bin
inflating: /opt/VSCode-linux-x64/libchromiumcontent.so
inflating: /opt/VSCode-linux-x64/snapshot_blob.bin
inflating: /opt/VSCode-linux-x64/libnotify.so.4
inflating: /opt/VSCode-linux-x64/ThirdPartyNotices.txt


Run the following command to change the executable permission of the code file.

[root@linuxhelp1 vscode]# chmod +x /opt/VSCode-linux-x64/Code
[root@linuxhelp1 vscode]# /opt/VSCode-linux-x64/Code 
[33928:0918/005221:ERROR:browser_main_loop.cc(170)] Running without the SUID sandbox! See https://code.google.com/p/chromium/wiki/LinuxSUIDSandboxDevelopment for more information on developing with the sandbox on.
bash: cannot set terminal process group (-1): Inappropriate ioctl for device
bash: no job control in this shell



Run the following code to create a soft link.

[root@linuxhelp1 vscode]# ln -s /opt/VSCode-linux-x64/Code /usr/local/bin/code
[root@linuxhelp1 vscode]# code . 
[34084:0918/005439:ERROR:browser_main_loop.cc(170)] Running without the SUID sandbox! See https://code.google.com/p/chromium/wiki/LinuxSUIDSandboxDevelopment for more information on developing with the sandbox on.
bash: cannot set terminal process group (-1): Inappropriate ioctl for device
bash: no job control in this shell



To create the desktop launcher

Copy the icon file to /usr/share directory in order to create the desktop Launcher.

[root@linuxhelp1 vscode]# cp /opt/VSCode-linux-x64/resources/app/vso.png /usr/share/icons/ 


Then, create the desktop launcher having the extension .desktop as shown below inside the /tmp/vscode/ directory.

[root@linuxhelp1 vscode]# vim /tmp/vscode/visualstudiocode.desktop 
[Desktop Entry]
Name=Visual Studio Code
Comment=Multi-platform code editor for Linux
Exec=/opt/VSCode-linux-x64/Code
Icon=/usr/share/icons/vso.png
Type=Application
StartupNotify=true
Categories=TextEditor Development Utility 
MimeType=text/plain 


After creating the desktop file, copy it to /usr/share/applications/ directory to make it available in a single click from the browser or menu bar.

[root@linuxhelp1 vscode]# cp /tmp/vscode/visualstudiocode.desktop /usr/share/applications/ 


Now the Visual Studio Code icon is available in the main menu, click on the icon to work on the application.


Comment
Amango
Sep 24 2018
was just perfect , thanks helper ..
carlosjunior
Aug 29 2018
Thanks!
parthiban
May 31 2018
check whether you have permission for the /opt directory, if you are non-root user you cannot create any files inside the /opt directory, it was owned by root user.
churongzhang
May 31 2018
when I unzip VSCode-linux-x64.zip -d /opt/ it said cannot create /opt/VSCode-linux-x64 Permission denied what should i do
gandhistanislawmora
Mar 07 2018
How i can appear the extention button because dont appear after of this installation
Add a comment
FAQ
Q
Are my test runs secure in VS Studio?
A
Yes. While App Center prohibits uploading personally identifiable information (PII), Microsoft takes measures to ensure security across test runs by different users:
Any apps installed during a test run are uninstalled
All local storage is cleared from the device
Devices are restored to their default settings
Q
Why I need the Visual studio code?
A
Visual Studio Code is a free, code-optimized editor based on electron. It is known for its features Such as navigation, syntax highlighting, bracket matching, auto indentation, intellisense s
Q
How to disable crash reporting in VS cod?
A
VS Code collects data about any crashes that occur and sends it to Microsoft to help improve our products and services. Read our privacy statement to learn more.

If you don't wish to send cr
Q
Do I run a portable version of VS Code?
A
Yes, VS Code has a Portable Mode which lets you keep settings and data in the same location as your installation, for example, on a USB drive.
Q
What is the difference between VS Code and VS Community?
A
Visual Studio Code is a streamlined code editor with support for development operations like debugging, task running and version control. It aims to provide just the tools a developer needs for a quick code-build-debug cycle and leaves more complex workflows to fuller featured IDEs. For more details about the goals of VS Code