How to install Visual Studio Code on Linux

Install Visual Studio Code using snap Package

How to install Visual Studio Code on Linux

VS Code is a powerful IDE, an open-source and cross-platform source code editor. It is developed by Microsoft that enables different developers to build applications and generate code using several programming languages in which python, C/C++, Java and Go are a few of them. It offers various amazing features in which built-in debugging support, syntax highlighting, integrated terminal, code completion; embedded Git control, snippets, and code refactoring are included. Visual Studio Code can install on different Linux flavors, macOS, and Windows operating systems.

This guide will explain the step-by-step installation of Visual Studio Code on Linux distributions.

Prerequisites

[tool]Linux distributions such as Debian, Ubuntu or CentOS should install on your system.[/tool]

[tool]User should have root or sudo privileges[/tool]

Install Visual Studio Code on Ubuntu, Debian, and LinuxMint Distributions

[openingText]The most recommended and suitable method for installing the visual studio code IDE on Debian-based distributions is by including the VS code repository on your system and then installing the visual studio code package by using the apt command. Therefore, first, install the necessary system updates by using the below-mentioned command:[/openingText]

$ sudo apt update

Step 1:
[stepName]Install VS Code Dependencies[/stepName]

[step]

After installing the all system updated, install required packages or dependencies by using the below-mentioned command:

$ sudo apt install software-properties-common apt-transport-https

[stepImage]screenshot of terminal[/stepImage]

[/step]

Step 2:
[stepName]Import Microsoft GPG key[/stepName]

[step]

In this step, you will import the Microsoft GPG key for VS code by using the following wget utility as follows:

$ wget -q https://packages.microsoft.com/keys/microsoft.asc -O- | sudo apt-key add –

[stepImage]screenshot of terminal[/stepImage]

[/step]

Step 3:
[stepName]Enable Visual Code repository[/stepName]

[step]

Enable the VS code repository by executing the following command:

$ sudo add-apt-repository "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main"

[stepImage]screenshot of terminal[/stepImage]

[/step]

Step 4:
[stepName]Visual Studio Code installation[/stepName]

[step]

After enabling the VS Code repository, start the Visual Studio code installed on your system. Update the apt packages list and then install the VS Code editor by running the below-mentioned command:

$ sudo apt update

$ sudo apt install code

[stepImage]screenshot of terminal[/stepImage]

Once the VS code installation is completed, you can start and use it on your Linux system.

[/step]

Step 5:
[stepName]Launch Visual Studio Code IDE[/stepName]

[step]

To launch the VS Code IDE on your Ubuntu system, search vs code in the application search bar. The following visual studio code icon shows in the search result.

[stepImage]screenshot of application search bar[/stepImage]

When you start visual studio code first time on your Linux system, the following interface displays on the desktop:

[stepImage]screenshot of Visual Studio Code[/stepImage]

[/step]

[stepName]Install Visual Studio Code on CentOS, Fedora distributions[/stepName]

[step]

The installation of VS code on Red hat based distributions is quite similar to Ubuntu. So, by using the dnf package manager, you can easily install visual studio code on CentOS, Fedora, and RHEL distributions. Login as a root user or with sudo privileges Update the system packages list by using the following command:

$ sudo dnf update

Now, import the VS code GPG key by using the rpm command as follows:

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

Create a new VS code repository file by executing the below-mentioned command:

$ sudo nano /etc/yum.repos.d/vscode.repo

Paste the following lines in the repository file:

[code]

name=Visual Studio Code

baseurl=https://packages.microsoft.com/yumrepos/vscode

enabled=1

gpgcheck=1

gpgkey=https://packages.microsoft.com/keys/microsoft.asc

[stepImage]screenshot of dnf package manager[/stepImage]

Finally, after adding the GPG key details use the following command to install visual studio code:

$ sudo dnf install code

[stepImage]screenshot of dnf package manager[/stepImage]

Once the VS code installation is completed, launch it by using the application menu or by using the application search bar:

[stepImage]screenshot of application search bar[/stepImage]

[/step]

[stepName]Install Visual Studio Code using snap Package[/stepName]

[step]

The VS code snap package distributed and managed by Microsoft teams. Almost all Linux distributions support the snap packages. Therefore, install the snap application and then type the following command to install VS Code editor on the Linux system:

$ sudo snap install --classic code

[/step]

Conclusion           

We demonstrated different methods in this article about how to install VS Code on a Linux system. You can adopt any method from the all above-mentioned ways according to their installed Linux distribution. Using the VS code editor, you can develop applications using diverse programming languages but mainly used for C and Python programmers.

How To Examine And Repair A Database in PhpMyAdmin

Over the period of time, database can be corrupted and needs to repaired. This t
less than a minute
Elizabeth Grom
Elizabeth Grom
Hosting Expert

How To Find and Install A New Theme in Drupal 8

This tutorial will help you replace the default Drupal theme with your preferred
less than a minute
Elizabeth Grom
Elizabeth Grom
Hosting Expert

How To Create Views in Drupal 8

This tutorial is compiled to help you create a view in your Drupal 8 platform.
less than a minute
Elizabeth Grom
Elizabeth Grom
Hosting Expert

How To Set up a VSFTPD Server on a CentOS 7 VPS or Dedicated Server

Brief Description FTP is usually insecure exposing clear-text passwords, usernam
less than a minute
Eliran Ouzan
Eliran Ouzan
Web Designer & Hosting Expert
Click to go to the top of the page
Go To Top
HostAdvice.com provides professional web hosting reviews fully independent of any other entity. Our reviews are unbiased, honest, and apply the same evaluation standards to all those reviewed. While monetary compensation is received from a few of the companies listed on this site, compensation of services and products have no influence on the direction or conclusions of our reviews. Nor does the compensation influence our rankings for certain host companies. This compensation covers account purchasing costs, testing costs and royalties paid to reviewers.