Visual Studio Code is a free and powerful source-code editor made by Microsoft for Windows, Linux, and macOS. VSCode offers many features such as support to debug applications, embedded Git control which helps you with code completion or refactoring when needed (it even has snippets!), plus much more! You can find extensions in this extensive library that will further enhance your software development experience – all at no cost whatsoever; thanks also to being able through its continuously updated extension model to make sure those updates come quickly, so there are never any downtime periods.
In the following tutorial, you will learn how to Install Visual Code Editor (VS CODE) on Debian 11 Bullseye using the command line terminal to import the Microsoft official repository and gpg key and install the IDE editor, along with how to maintain and remove the software if required in the future.
Table of Contents
Firstly, it is advised to update your system to ensure all existing packages are up to date to avoid any conflicts during the installation.
sudo apt update && sudo apt upgrade -y
Install Required Packages
The following packages must be installed to assist in installing the software.
sudo apt install software-properties-common apt-transport-https wget -y
If unsure, run the command; it will not harm you.
These are the most common software packages found on nearly all Linux distributions.
Import Visual Studio Code Repository
First, you will need to import the Microsoft GPG key to verify the authenticity of the installation package.
wget -O- https://packages.microsoft.com/keys/microsoft.asc | sudo gpg --dearmor | sudo tee /usr/share/keyrings/vscode.gpg
Secondly, import the Microsoft Visual Source Repository with the following command in your terminal.
echo deb [arch=amd64 signed-by=/usr/share/keyrings/vscode.gpg] https://packages.microsoft.com/repos/vscode stable main | sudo tee /etc/apt/sources.list.d/vscode.list
Install Visual Studio Code
With the source repository sorted, you must refresh your apt package manager sources list to reflect the new addition before the Visual Studio installation.
Run the following command in your terminal to reflect the newly added repository.
sudo apt update
Next, install the VSCode version you prefer, with most users selecting the stable version. However, for those that want to test the bleeding-edge version, install the insiders build, which is the beta.
sudo apt install code -y
Install VSCode Insiders (Beta)
sudo apt install code-insiders -y
Note that you can install both versions as they share separate installations.
How to Launch Visual Studio Code
Now that you have completed the installation, you can open the software in a few ways.
Using the command line terminal, you can open the software quickly by using the following command.
The best way to use VSCode for desktop users that prefer not to use the command line terminal is to open the GUI of the application by following the path.
Activities > Show Applications > Visual Studio Code
Once open, you can begin to use the IDE editor. For users that may want a more private version check out “How to Install VSCodium on Debian 11 Bullseye” which, for the most part, works excellent beside a few sacrifices like access to the Microsoft store.
Select the theme you want. Dark is the default and is the most popular, but the tutorial white will be chosen to change the default.
Click Mark Done on the bottom left-hand side.
Congratulations, you have installed Microsoft Visual Studio Code.
How to Remove (Uninstall) Visual Studio Code
To remove the Visual Studio software from your system, run the following command in your terminal.
sudo apt remove code --purge
Note that the –purge flag removes all data created with VSCode.
Remove VSCode Insiders (Beta)
sudo apt remove code-insiders --purge
Next, remove the repository using the following command.
sudo rm /etc/apt/sources.list.d/vscode.list
For good housekeeping and security, remove the GPG key as follows.
sudo rm /usr/share/keyrings/vscode.gpg
Comments and Conclusion
If you are looking for an excellent, lightweight IDE editor that can handle a variety of programming languages, Microsoft Visual Studio Code is the best option on the market. With its vast library of extensions and themes and its intuitive user interface, VS Code will make your coding experience more enjoyable.