Visual Studio Code is an optimized, feature-rich code editor for building web and cloud applications. It is developed by the Microsoft team. It includes features like embedded Git, supports debugging features, syntax highlighting, intelligent code completion, snippets, and code refactoring.
The Visual Studio Code is freely available for most modern operating systems like Windows, Linux (RPM and Debian installation are also available), and macOS.
This tutorial will help you to install Visual Studio Code editor on Ubuntu 20.04 using Apt repository as well as the snap tool.
Prerequisites
Before continuing for Visual Studio Code installation on Ubuntu 20.04:
- Login to Ubuntu as sudo privileged user
- For the newly installed systems, required to complete initial server setup
Step 1 – Install Visual Studio Code
Choose one of the below methods to install Visual Studio Code on your Ubuntu system. The Ubuntu 20.04 LTS preferred to use snap tool instead of Apt for packages installation. So, we are providing installation method with snap tool first.
Method 1 – How to Install VS Code using Snap
The snap package contains all the requirements for any application. So just execute the below command on your system terminal:
sudo snap install code --classic It will download the eclipse IDE snap package and install on your machine. Once the installation completed successfully, you will see the following output.
The snap package has been installed on your system.
Next method will instruct you to install visual studio code using the apt package manager. But if you already have installed using snap tool, skip next method.
Method 2 – How to Install VS Code with PPA
First, Import the GPG key to your system to verify packages before installation. To import gpg key, type:
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg Microsoft team provides an repository for the Debian packages installation. To enable the Visual Studio code Apt repository, type:
echo "deb [arch=amd64] http://packages.microsoft.com/repos/vscode stable main" | sudo \ tee /etc/apt/sources.list.d/vs-code.list Once you successfully added the repository to your system, Execute the following commands to install Visual Studio Code on Ubuntu system.
sudo apt update sudo apt install code
Step 3 – Launch Visual Studio Code
Now, The Visual Studio Code has been installed on your Ubuntu 20.04 system. To launch the application type “code” in search application and click on it.
The Visual Studio Code editor is ready to use.
There are a large number of extensions available for Visual Studio Code like C#, Python, JavaScript, Google Chrome etc. Install the required extensions to enhance your working experience with the Visual Studio Code.
Conclusion
This tutorial helps you to install Visual Studio Code on your Ubuntu 20.04 LTS system.
1 Comment
Thank you for this tutorial, sir. I used the first method and it worked without problems.
When it comes to snap vs apt, which one should be preferred?