How to install Visual Studio Code in Linux

The Visual studio code is one of the best-integrated development environment or IDE in short. Its simple design and easy to use approach make it favorite of all. Most of the programmers already moved Visual studio code. Especially popular among Python and C programmers. So if you are new to programming or an old player who wants a good IDE, VS Code is made for you. In this article, I will show you how to install Visual Studio code in a Linux PC.

Linux is becoming more and more popular among programmers. Also, the VS code is available for Linux. Therefore, in this article, we will come to know about the complete process to install VS Code in Linux PC. Installing VS code in Linux isn’t difficult. Just through some command in the terminal and you are good to go.

How to install the Visual Studio Code in Linux?

As I said earlier, you just need to put in some commands in the terminal. There are two types of distributions. First is Debian based Linux distributions like Ubuntu and Linux Mint. Secondly, RedHat based Linux distributions like CentOS and Fedora. Therefore, I will explain how you can install the Visual Studio Code in different Linux distributions. So let us get started.

Install Visual Studio Code in Debian based Linux.

Ubuntu is a Debian based Linux distribution. LUbuntu, Linux Mint is further based on Ubuntu. So the installation method of Visual Studio code will be the same for these Linux distributions. To install Visual Studio Code in Debian based Linux:

  • First. Open the terminal and update repositories by this command:

sudo apt update

  • Then,

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

  • Now get the Microsoft GPG key by the following command

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

  • After that, get the visual studio code repositories

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

  • you need to update the repositories again. Use this command:

sudo apt update

  • Finally, install the Visual Studio Code by the following command:

sudo apt install code

All done, Visual Studio Code will now start to download and install. After the installation is finished, you can go to apps and launch. This process is the same for Ubuntu, Linux, and other Ubuntu-based Linux distribution. So follow this tutorial for installation of VS code in Ubuntu-based Linux distribution.

Install Visual Studio Code in RedHat based Linux distributions.

CentOS, Fedora, and some other RedHat based Linux distributions use the following method. Therefore, if you want to install the visual studio code in RedHat based Linux then follow this tutorial. Commands we will use might look similar to Ubuntu but trust me it is a whole another story.

For RedHat based Linux distribution:

  • First, open the terminal and update your system

sudo dnf update

  • Get the Microsoft GPG keys

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

Now you will need to create a repository file and some lines of code to it. Follow as shown below

  • Create the file

sudo vim /etc/yum.repos.d/vstudio_code.repo

  • then edit this file add these lines:

[code]

name=Visual Studio Code

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

enabled=1

gpgcheck=1

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

  • At last through this command in terminal to install Visual studio code.

sudo dnf install code.

All done, Visual Studio Code is now ready to use.

That’s it folks!!

Above is the complete guide on installing the Visual Studio Code in Linux. Whether you are using Debian based or RedHat based Linux distribution, This article has got you covered. Visual Studio Code is a simple yet powerful code editor. It has got all the features that a programmer wants from a good code editor. A ton of Plug-ins for a seamless workflow. So go ahead and try it yourself.