2 Ways to install VS code on Debian 11 Bullseye Linux

Learn the simple way to install Microsoft Visual Studio Code on Debian 11 Bullseye or 10 Buster using the command terminal.

Microsoft’s “Visual Studio Code”  is a free and open-source code editor available to install on popular operating systems. It also contains many useful functions for developers. Although the tool comes from Microsoft, it is also available for Mac OS and Linux, which makes the cross-system development of applications in teams much easier.

Microsoft promises that applications with ASP.NET Framework and Node applications, in particular, should be able to 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. Your project can be created as a Git repository. To make the coder’s life easier, VSCode has integrated some convenience functions, such as syntax color coding, auto-completion of code, and bracket matching.

Well, you would already know about this Coding platform, hence, let’s talk about the main topic of this article which is the simple way to install VS Code on the latest Debian 11 or 10 desktop Linux distro.

Steps to install Visual Studio Code on Debian 11 or 10

The steps given here are also applicable to Kali Linux, Ubuntu, Linux Mint, Elementary OS, MX Linux, POP!_OS, and others.

#1st Way using repo:

Add Microsoft Visual Studio Code GPG Key and repository

We need to add a key that has been used to sign the packages of this coding platform. Otherwise, the system will not accept the VSCode repository to download the required packages.

sudo apt-get install wget gpg
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg
sudo install -D -o root -g root -m 644 packages.microsoft.gpg /etc/apt/keyrings/packages.microsoft.gpg
sudo sh -c 'echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" > /etc/apt/sources.list.d/vscode.list'
rm -f packages.microsoft.gpg

Run system update

To ensure that the system could recognize the newly added repo packages, run the system update command once:

sudo apt update

Command to install Visual Studio Code

finally, run a single command to get the packages on your Debian system to install VS Code:

sudo apt install code

Uninstallation (optional)

Well, there is always a point when you don’t require any installed application, and if the same goes for VSCode then here are the commands to completely remove it.

sudo apt remove code
sudo rm /etc/apt/sources.list.d/vscode.*
sudo rm /etc/apt/trusted.gpg.d/ms_vscode_key.gpg

2nd Method using Deb binary file directly

Open browser in Debian

Go to your Debian Linux system and open whatever browser you have. However, the default one is Firefox.

Download the VS Code Debian Package

The next step is to visit the official webpage of VS code to download the package available to install on Debian and its based Linux systems. Here is the link to the download page.

Download VS code for Debian Linux

Switch to Downloads

First, open the Command Terminal. If you have used the browser to download the Visual Studio code Debian file, then switch to “Downloads“. It is because the file we get from the browser goes automatically into that.

cd Downloads

Install Visual code Studio on Debian 11 or 10

Now, we can either use the APT package manager or DPKG tool to install the downloaded .deb file of VS Code. To do that, simply run the below-given command.

sudo apt install ./file-name.deb

Replace file-name. deb with the actual name of the file you have downloaded.

sudo apt install ./code_*_amd64.deb

Run the Code Editor

Go to All Applications, search for VScode and when its icon appears, click to run the same.

Simple Way to insall VS code on Debian 11 Linux

Uninstall or Remove

Those who don’t require Visual Studio Code anymore on their Debian Linux can remove it using the command:

sudo apt remove code

Other Articles:

4 thoughts on “2 Ways to install VS code on Debian 11 Bullseye Linux”

  1. I have read that adding things in sources.list or installing things outside the disto repositories can potentially make your system a Frankenstein monster. Isn’t there any safer way to do this.

    • Use the second method using directly Debian package of VS code, however that will also add an additional repository to get future updates. And adding an additional repository from a safe source will not make a system Frankenstein monster at all.

  2. E: The repository ‘https://packages.microsoft.com/debian/10/prod bullseye Release’ does not have a Release file.
    N: Updating from such a repository can’t be done securely, and is therefore disabled by default.
    N: See apt-secure(8) manpage for repository creation and user configuration details.

    • But we haven’t mentioned anywhere in this article about the repository you are pointing. May be you already haved added that from somewehre else so first revmoe it.


Leave a Comment

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