HowTo: Install Microsoft's Visual Studio Code On Linux Ubuntu

According to the official website:

Visual Studio Code is a lightweight but powerful source code editor which runs on your desktop and is available for Windows, macOS and Linux. It comes with built-in support for JavaScript, TypeScript and Node.js and has a rich ecosystem of extensions for other languages (such as C++, C#, Java, Python, PHP, Go) and runtimes (such as .NET and Unity).

VS Code is a free and open-source text and source code editor for macOS, Linux, and Microsoft Windows. In this post we are going to discuss the process of installing Visual Studio Code on Ubuntu and Ubuntu based Linux distributions.

> Install using official package repository

The process of installing VS Code from the official package repository is fairly simple. Open a terminal by pressing Ctrl + Alt + T and follow the steps given below:

Step 1:

Run the following command to add the package repository to your system:

curl | gpg --dearmor > microsoft.gpg
sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg
sudo sh -c 'echo "deb [arch=amd64] stable main" > /etc/apt/sources.list.d/vscode.list'

Step 2:

Update the package cache to incorporate the new changes:

sudo apt-get update

Step 3:

Finally, to install Atom run:

sudo apt-get install code

> Install using .deb package

Step 1:

Download the package by clicking here and selecting the .deb option.

Before proceeding remember to change your working directory in terminal to the directory where the .deb package was dowloaded. Use the cd command to change directory.

Step 2:

Install the package using the dpkg command:

sudo dpkg -i FileName.deb

Replace FileName with the name of the file you just downloaded.

Step 3:

Finally, to install any missing dependencies run:

sudo apt-get -f install

Installing the .deb package will automatically add VS Code to your apt repository and can thus be updated automatically with the regular system updates.

Visual Studio Code has now been successfully installed on your system. Any further queries and suggestions are welcome in the comments section below. If your are interested in Sublime Text or Atom find the installation guide here and here respectively. A detailed post about ten best plugins to get you started with Visual Studio Code are coming soon.

Show Comments