Visual Studio Code (VSCode) is an open-source, cross-platform code editor developed by Microsoft that works with many different programming languages, including Python and JavaScript.
It also supports debugging, embedded Git Control, syntax highlighting, and code completion features.
Here, we will see how to install Visual Studio Code on Debian 11 / Debian 10.
Setup Visual Studio Code Repository
Microsoft provides VS Code package through its official repository. So, we must set up VS code repository on the system before we install VS Code.
Update the repository index using the apt command
sudo apt update
Install the HTTPS support for apt to get packages from Microsoft and other repositories.
sudo apt install -y curl apt-transport-https
Download and import the Microsoft signing GPG key.
Debian 11
curl -sSL https://packages.microsoft.com/keys/microsoft.asc -o microsoft.asc gpg --no-default-keyring --keyring ./ms_signing_key_temp.gpg --import ./microsoft.asc gpg --no-default-keyring --keyring ./ms_signing_key_temp.gpg --export > ./ms_signing_key.gpg sudo mv ms_signing_key.gpg /etc/apt/trusted.gpg.d/
Debian 10
curl -sSL https://packages.microsoft.com/keys/microsoft.asc -o microsoft.asc sudo apt-key add microsoft.asc
Now, add the Microsoft Visual Studio Code repository to your system.
echo "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main" | sudo tee /etc/apt/sources.list.d/vscode.list
Install Visual Studio Code On Debian
Update the repository index.
sudo apt update
Use the below command to install the Visual Studio Code.
sudo apt install -y code
Launch Visual Studio Code
Once the VS Code is installed on your system, you can launch it from the command line with code or by going to Activities ยป Search for Visual Studio Code.
You will get the Get started with VS code window on the first launch.
Set VS Code as the default editor
If you have multiple source code editors on your system and want to set the Visual Studio Code as the default code editor, use the below command.
sudo update-alternatives --set editor /usr/bin/code
Update Visual Studio Code
Microsoft releases the update every month for VS Code. So, you can follow the below steps to update the Visual Studio Code to the latest version.
sudo apt update sudo apt upgrade code
Sumber: disini