Welcome to our guide on how to install Visual Studio Code (vscode) on CentOS 8 / RHEL 8. Visual Studio Code is a popular source-code editor originally developed by Microsoft for Windows, but can now be installed on Linux and macOS. It is redefined and optimized for building and debugging modern web and cloud applications.

For RHEL/CentOS Linux distributions, the Visual Studio Code package is available on an RPM repository maintained by Microsoft.

Step 1: Import Microsoft GPG key

Step 1 is to import the GPG key used for signing the packages.

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

Once this is done, proceed to step 2.

Step 2: Add VS Code repository

Once the GPG key is added, continue to add the VS Code repository.

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

Step 3: Install Visual Studio Code on CentOS 8 / RHEL 8

We’re now ready to install Visual Studio Code on CentOS 8 / RHEL 8. All you need to do is run the following command on your terminal.

sudo dnf install code

When prompted to Agree to installation, press “y“.

................
Updating Subscription Management repositories.
Visual Studio Code                              924  B/s | 2.9 kB     00:03    
Dependencies resolved.
================================================================================
 Package      Arch           Version                         Repository    Size
================================================================================
Installing:
 code         x86_64         1.34.0-1557958058.el7           code          66 M

Transaction Summary
================================================================================
Install  1 Package

Total download size: 66 M
Installed size: 189 M
Is this ok [y/N]: y
Downloading Packages:

See all the information regarding installed package.

$ rpm -qi code
Name        : code
Version     : 1.34.0
Release     : 1557958058.el7
Architecture: x86_64
Install Date: Sat 25 May 2019 01:56:39 AM EDT
Group       : Development/Tools
Size        : 198482898
License     : Multiple, see https://code.visualstudio.com/license
Signature   : RSA/SHA256, Thu 16 May 2019 01:58:00 PM EDT, Key ID eb3e94adbe1229cf
Source RPM  : code-1.34.0-1557958058.el7.src.rpm
Build Date  : Wed 15 May 2019 06:07:51 PM EDT
Build Host  : 5dcb5d0bcd2d
Relocations : (not relocatable)
Packager    : Visual Studio Code Team <[email protected]>
Vendor      : Microsoft Corporation
URL         : https://code.visualstudio.com/
Summary     : Code editing. Redefined.
...................

Step 4: Launch Visual Studio Code on CentOS 8 / RHEL 8

After installing any package, you’ll definitely want to use it. To launch Visual Studio Code on CentOS 8 / RHEL 8, you can use CLI

$ code

or Gnome Activities search function.

You should see the VS Code welcome window.


Enjoy your development with Visual Studio Code on Fedora. Check a comprehensive guide on how to use VS Code. Watching Introductory Videos should also help you get started.

Similar Articles:

How to Install Skype on CentOS 8 / RHEL 8

How to Install Slack on CentOS 8 / RHEL 8

How to Install Sublime Text 3 on CentOS 8 / RHEL 8

Install Atom Text Editor on RHEL 8 / CentOS 8