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

This article describes how to install Visual Studio Code on CentOS 8.

Prerequisites

The instructions assume that you are logged in as a user with sudo privileges.

Installing Visual Studio Code on CentOS

The easiest and recommended way to install Visual Studio Code on CentOS 8 systems is to enable the VS Code repository and install the VS Code package through the command line:

  1. Import the Microsoft GPG key:
    sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
  2. Run the following command:
sudo sh -c 'echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" > /etc/yum.repos.d/vscode.repo'

Install the latest version of Visual Studio Code by typing:
sudo dnf install code

That’s it. Visual Studio Code has been installed on your CentOS desktop and, you can start using it.

Starting Visual Studio Code

Now that VS Code is installed on your CentOS system, you can launch it either from the command line by typing code or by clicking on the VS Code icon (Applications -> Programming -> Visual Studio Code).

When you start VS Code for the first time, a window like the following should appear:

You can now begin installing extensions and configuring VS Code according to your preferences.

Updating Visual Studio Code

When a new version is released you can update the Visual Studio Code package through your desktop standard Software Update tool or by running the following command in your terminal:

sudo dnf update
Esta resposta lhe foi útil? 194 Usuários acharam útil (195 Votos)