4 Ways to install VS Code Editor on Ubuntu 22.04 | 20.04 LTS

Learn the best ways to install Microsoft VS Code (Visual Studio Code) using the command terminal & GUI on Ubuntu 20.04 Focal fossa and 22.04 LTS Jammy Jelly Fish.

Well, although it is from Microsoft, however, Visual Studio Code Editor is free to use and distributed under an Open Source license. The code editor is cross-platform supported, hence can easily be installed on Linux as well as macOS.

As per Microsoft, the applications with ASP.NET Framework and Nodejs can be created very quickly on VS code. And that is the reason Visual Studio code comes with built-in debugging support for the Node.js runtime environment. Developers can debug JavaScript, TypeScript, and any other language based on JavaScript in VS Code without the need for an additional tool. Also, website creation with HTML, CSS, JSON, LESS, SASS, PHP JavaScript, and other technologies is very easy.

Those who do not want to install the VSCode in their local system can go for the Visual Studio Code web browser version. Here is the link to visit it.


Steps to install visual studio code in Ubuntu 22.04 | 20.04 LTS Linux

Given steps will also work for Debian, Linux Mint, POP!OS, Elementary, MX Linux, Ubuntu 18.04/19.04/21.04, and other similar Linux distros.

#1st way using GUI:

Using Graphical Ubuntu Software

Although developers won’t have any problem with the command line, still if you want this Code editor from the SNAP repository then you can easily get it using the in-built Ubuntu software App installer.

Click on the Ubuntu Software icon, given on the Dock. Or else search the same in the Application launcher to run it.

Install Visual code studio on Ubuntu 22.04

Search for Vscode and when it appears, click to open it, hit the Install button.

Vscode install ubuntu 20.04 using GUI



#2nd-way using terminal

Open Command Terminal

On your terminal, run once the system update command. It will refresh the APT repository cache.

sudo apt update


Download VScode on Ubuntu 20.04 | 22.04 LTS

Now, let’s download the Debian binary officially made available by Microsoft to install on Debian and its based system such as Ubuntu.

sudo apt install wget -y
wget -O vscode.deb 'https://code.visualstudio.com/sha/download?build=stable&os=linux-deb-x64'


Install Visual Code Binary on Linux

Next, we have the binary now either use the DPKG command tool or APT package manager to install it. Here we will use APT as it can also solve any dependency required by the binary.

sudo apt install ./vscode.deb



Those who don’t require this code editor anymore can remove it using this command syntax:

sudo apt remove code -y


#3rd- Use Repository

Add VSCode Repository on Ubuntu 20.04 | 22.04 LTS

Developers, who want to go for manually adding the repository and then perform the installation of Visual Code Editor using APT package manager can follow these steps:

Insert Repo: Copy-Paste the given block of command.

sudo sh -c 'echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/trusted.gpg.d/packages.microsoft.gpg] \ 
https://packages.microsoft.com/repos/code stable main" > /etc/apt/sources.list.d/vscode.list'


Add GPG Key

Next, add the GPG key used to sign the packages of VScode by Microsoft.

wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg
sudo install -o root -g root -m 644 packages.microsoft.gpg /etc/apt/trusted.gpg.d/
rm -f packages.microsoft.gpg


Run system update

Finally, use the update command to let the system know we have recently added a new repository. Subsequently, it will rebuild the repo cache and know where are the packages available for Microsoft’s Open source Vscode to install.

sudo apt update


Use APT to install Visual Studio Code on Ubuntu Focal or Jammy

Next, use the normal APT command to get this open-source code editor on your Linux system.

sudo apt install code


To Remove:

sudo apt remove code -y


#4th Method: Using SNAP Command

Use SNAP Command

Although this method is similar to the first one, we used to download and install the VS code editor using a Graphical user interface. The only difference is here we are using the same SNAP repository but from the command terminal.

As we know SNAP comes by default installed on Ubuntu operation systems. Hence just fire a single given command and you are done!!

sudo snap install --classic code

To delete or uninstall, the command will be:

sudo snap remove code




Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.