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.
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
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.
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.
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.
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