Install Visual Studio Code on Debian

by | Last Updated: Mar 29, 2023 | LINUX, SOFTWARE

Visual Studio Code (VS Code) is a Microsoft-developed and maintained, freeware code editor. It can be used in all popular Linux distributions. Features such as Debugging, syntax highlighting, intelligent code completion, snippets, code refactoring, and embedded Git make visual studio code very popular among the development community.

Visual Studio Code can be used as a simple code editor by default. However, by installing extensions, its capabilities may be further enhanced, transforming it into a robust Integrated Development Environment (IDE). You can install the Python extension in VS Code, for example, to turn it into a lightweight Python IDE. Let me show you two different methods to install visual studio code in simple steps.

It is assumed that

  1. Debian Linux has already been installed and it has internet access.
  2. You are logged in as a user with Sudo privileges.

Download & Install VS Code in Debian

We can download and install VS Code by following two methods:

  1. Use a web browser to download the package file and then install it.
  2. Use a Linux terminal to add a repository and key so as to install VS code.

Method 1: Install VSCode Using a Web Browser

If you want to keep it simple and easy, use this method. Using this method, it will automatically install the apt repository and signing key to enabling auto-updating.

Step 1: Visit VS Code official website from Debian OS and download the .deb file/package.

download visual studio code for debian

If you are using Red Hat Linux / Fedora / CentOS, you may download .rpm file.

Step 2: Save the package. Click OK. Usually, it saves it in the Downloads folder.

save vscode deb file
downloaded vscode deb file

Step 3: To install this package, open a terminal program and Navigate the path where the file is downloaded. The file is downloaded in /home/raees/Downloads folder.

Linux Terminal Command

raees@debian:~$ cd /home/raees/Downloads
raees@debian:~/Downloads$ ls

Use dpkg command to install visual studio code.

Linux Terminal Command

raees@debian:~/Downloads$ sudo dpkg -i code_1.60.2-1632313585_amd64.deb
[sudo] password for raees:
Selecting previously unselected package code.
(Reading database ... 163281 files and directories currently installed.)
Preparing to unpack code_1.60.2-1632313585_amd64.deb ...
Unpacking code (1.60.2-1632313585) ...
Setting up code (1.60.2-1632313585) ...
Processing triggers for gnome-menus (3.36.0-1) ...
Processing triggers for desktop-file-utils (0.26-1) ...
Processing triggers for mailcap (3.69) ...
Processing triggers for shared-mime-info (2.0-1) ...

That’s it. You are done with the installation.

Method 2: Using Command Line / Terminal

With this method, you will install the repository and key manually by using the following commands:

For Debian 11

1. Update the index of the repository.

sudo apt update

2. Install curl and HTTPs support for apt so as to get packages from online repositories.

sudo apt install -y curl apt-transport-https

3. Download and import the GPG key from Microsoft.

curl -sSL | sudo gpg –dearmor -o /usr/share/keyrings/ms-vscode-keyring.gpg

4. Add VS Code respository to your system.

echo “deb [arch=amd64 signed-by=/usr/share/keyrings/ms-vscode-keyring.gpg] stable main” | sudo tee /etc/apt/sources.list.d/vscode.list
5. Once again, update the index of the repository.
sudo apt update
6. Install VS Code now.
sudo apt install -y code

Verify VS Code Installation

To open visual studio code, click on the Applications menu and click on Visual Studio Code under the Development menu item.

run vscode debian menu
You may also run visual studio code through Linux terminal. Just type code and press Enter.
raees@debian:~/Downloads$ code
run vscode debian

The Upshot

  • Visual Studio Code is a freeware cross-platform code editor managed by Microsoft that can be run on Debian Linux.
  • Numerous extensions are available to install inside VS Code that further extends its functionality.
  • VS Code can work as a powerful IDE for different programming languages. For instance, installing python and Pylance extension extends your environment with features such as IntelliSense, Linting, Code formatting, Debugging, Testing, etc…
Major Open Source Applications

Open-source software and applications are free, stable, and secure. For all types of open-source applications, the original source code is available.

Linux Distributions

A Linux Distribution is an OS with collection of software on top of Linux kernel. Community vs Enterprise Linux Distros. RPM vs Debian Based Linux Distros.


Submit a Comment

Your email address will not be published. Required fields are marked *

Pin It on Pinterest

Share This

Share This

If you liked this post, please share it with your friends.