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

Learn to install Microsoft VS Code (Visual Studio Code) using the command terminal & GUI on Ubuntu 24.04 Noble and 22.04 LTS Jammy Jelly Fish.

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

As per Microsoft, applications with ASP.NET Framework and Node.js can be created very quickly on Visual Studio code. That is why 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 needing an additional tool. Also, website creation with HTML, CSS, JSON, LESS, SASS, PHP, JavaScript, and other technologies is effortless.

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

 

Steps to install Visual Studio code in Ubuntu 24.04 | 22.04 LTS Linux

The article 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, if you want this Code editor from the SNAP repository, you can easily get it using the built-in Ubuntu Software App installer.

Click on the Ubuntu Software icon in the Dock. Alternatively, search for it in the Application Launcher to run it.

Install Visual code studio on Ubuntu 22.04

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

Vscode install ubuntu 20.04 using GUI

 

#2nd-way using terminal

Open Command Terminal

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

sudo apt update

 

Download VScode on Ubuntu 24.04 | 22.04 LTS

Now, let’s download the Debian binary officially made available by Microsoft for installation on Debian and its systems, 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. We can now use the DPKG command tool or the 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

 

Uninstallation

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 24.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 Microsoft’s VScode packages.

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 recently added a new repository. Subsequently, it will rebuild the repo cache and know where the packages are 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 standard 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 Graphic user interface. The only difference is that here, we are using the same SNAP repository but from the command terminal.

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

sudo snap install --classic code

To delete or uninstall, the command will be:

sudo snap remove code

 

Leave a Comment

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