How To Install Visual Studio Code On Ubuntu 20.04

THIS DOCUMENT IS ALSO AVAILABLE FOR

Visual Studio Code (VsCode) is a free cross-platform source-code editor developed by Microsoft for Windows, Linux, and macOS. It supports debugging, embedded Git control, syntax highlighting, code completion and refactoring, and snippets.

In addition to its core functionality, you can install extensions to change the look, support new programming languages, custom components, etc.

Here, we will see how to install Visual Studio Code on Ubuntu 20.04.

Configure Visual Studio Code Repository

Microsoft provides the package repository for Ubuntu which helps us to get and install the VsCode package easily.

Update the repository index using the apt command

sudo apt update

Install the HTTPS support for apt to get packages from Microsoft and other packages.

sudo apt install -y curl apt-transport-https

Download and import the Microsoft signing GPG key.

curl -sSL https://packages.microsoft.com/keys/microsoft.asc -o microsoft.asc

sudo apt-key add microsoft.asc

Now, add the Microsoft Visual Studio Code repository to your system.

echo "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main"  | sudo tee /etc/apt/sources.list.d/vscode.list

Install Visual Studio Code

Update the repository index.

sudo apt update

Use the apt command to install the Visual Studio Code.

sudo apt install -y code

Start Visual Studio Code

Terminal

Once the VS Code is installed on your system, you can launch it either from the command line or by clicking on the VS Code icon in graphical mode.

code

Graphical

Go to Activities » Search for Visual Studio Code.

Start Visual Studio Code on Ubuntu 20.04
Start Visual Studio Code on Ubuntu 20.04

Visual Studio Code running on Ubuntu 20.04:

Visual Studio Code running on Ubuntu 20.04
Visual Studio Code running on Ubuntu 20.04

Set VS Code as the default editor

If your system has multiple source code editors and you want to set the Visual Studio Code as the default code editor, use the below command.

sudo update-alternatives --set editor /usr/bin/code

Update Visual Studio Code

Microsoft releases the update every month. So, if you want, you can update the Visual Studio Code to the latest version using the apt command.

sudo apt update

sudo apt upgrade code

Conclusion

That’s All. You have successfully installed the Visual Studio Code on your Ubuntu 20.04. Now, you are good to install the extensions and configure VS Code according to your preferences.

Prev Post
Next Post
comments powered by Disqus