How To Install Visual Studio Code On CentOS 7 / RHEL 7 & Fedora 30 / 29

0
This document is also available for

Visual Studio Code is a cross-platform source code editor developed by Microsoft. It has built-in debugging support, embedded Git control, syntax highlighting, code completion, code refactoring, and snippets.

Visual Studio Marketplace offers lots of plugins and extensions to extend the functionality of VS code.

This tutorial guides you on how to install Visual Studio Code editor on CentOS 7 / RHEL 7 & Fedora 30 / 29 from the Microsoft’s VS Code repository.

Configure Visual Studio Code Repository

Microsoft provides the official repository for easy installation of Visual Studio Code for CentOS / RHEL & Fedora operating systems. So, you can set up the Microsoft repository on your system receive the VS Code package.

Switch to the root user.

sudo su -

OR

su -

Download and import the Microsoft signing GPG key using the curl command.

rpm --import https://packages.microsoft.com/keys/microsoft.asc

Now, add the Visual Studio Code repository to your system.

cat << EOF > /etc/yum.repos.d/vscode.repo
[code]
name=Visual Studio Code
baseurl=https://packages.microsoft.com/yumrepos/vscode
enabled=1
gpgcheck=1
gpgkey=https://packages.microsoft.com/keys/microsoft.asc
EOF

Install Visual Studio Code

Once you have added the repository to the system, do not forget to check for using available package upgrades the yum command on CentOS or dnf command on Fedora.

### CentOS / RHEL ###

yum check-update

### Fedora ###

dnf check-update

Use the yum command on CentOS or dnf command on Fedora to install Visual Studio Code.

### CentOS / RHEL ###

yum install -y code

### Fedora ###

dnf install -y code

Start Visual Studio Code

Once the VS Code is installed on your system, you can launch it either from the command line or by clicking on the VS Code icon in graphical mode.

code

OR

CentOS: Menu >> Programming >> Visual Studio Code.

Start Visual Studio Code on CentOS 7
Start Visual Studio Code on CentOS 7

Fedora: Activities >> Search for Visual Studio Code.

Start Visual Studio Code on Fedora
Start Visual Studio Code on Fedora

Visual Studio Code running on CentOS 7:

Install Visual Studio Code On CentOS 7 - Microsoft Visual Studio Code Running on CentOS 7
Install Visual Studio Code On CentOS 7 – Microsoft Visual Studio Code Running on CentOS 7

Visual Studio Code running on Fedora:

Microsoft Visual Studio Code Running on Fedora
Microsoft Visual Studio Code Running on Fedora

Update Visual Studio Code

Microsoft releases the update for Visual Studio Code monthly. You can update the version of Visual Studio Code similar to other packages, using the apt command.

### CentOS / RHEL ###

yum update code

### Fedora ###

dnf update code

Conclusion

You have successfully installed Visual Studio Code on your CentOS 7 / RHEL 7 & Fedora 30 / 29. You can now install extensions and configure VS Code according to your preferences. Also, learn about the User Interface of VS Code.

You might also like