How to Install Visual Studio Code on Debian 12, 11 or 10

Visual Studio Code, often abbreviated as VSCode, has emerged as a top-tier code editor favored by developers worldwide. Its adaptability and comprehensive features make it a go-to tool in the coding realm. This guide details the steps to install Visual Studio Code on Debian 12 Bookworm or the older stable releases of Debian 11 Bullseye or Debian 10 Buster. Using Microsoft’s official VSCode repository, Debian users can ensure they’re always equipped with the most recent software updates.

Distinguishing Features of Visual Studio Code for Debian Users:

  • Adaptable Environment: VSCode’s extensive library of extensions empowers Debian developers to customize their workspace, enhancing productivity and catering to individual project requirements.
  • Unified Workspace: The integrated terminal in VSCode offers the convenience of executing code, debugging, and managing version control, all from a singular interface, streamlining the development workflow on Debian systems.
  • Broad Language Compatibility: With support for many programming languages, VSCode ensures that Debian developers can seamlessly transition between different projects without needing multiple editors.
  • Efficient Version Control: The native Git integration in VSCode facilitates smooth version control operations, a boon for Debian developers keen on maintaining organized and up-to-date code repositories.

Armed with these features and more, Visual Studio Code offers a robust coding environment, making it an invaluable asset for developers operating on Debian platforms. Let’s proceed in learning how to install the IDE software.

Pre-installation Steps for VSCode on Debian 12, 11 or 10

Step 1: Update Debian Before Visual Studio Code Installation

Before diving into the installation process, ensuring your Debian system is updated with the latest packages is essential. This will help prevent any potential conflicts during the installation of Visual Studio Code.

To update your system, open a terminal and run the following command:

sudo apt update

After updating the package list, proceed to upgrade any outdated packages with the following command:

sudo apt upgrade

Install Required Packages for VSCode on Debian

Next, you’ll need to install a few required packages to ensure a smooth installation of Visual Studio Code. These packages are standard across most Linux distributions and help manage repositories and securely download files.

Run the following command to install the necessary packages:

sudo apt install dirmngr ca-certificates software-properties-common apt-transport-https curl -y

Following these pre-install steps, you’ve prepared your Debian system to install Visual Studio Code. In the following steps, you’ll learn how to add the official Microsoft repository and install the latest version of Visual Studio Code.

Import Visual Studio Code Repository APT on Debian 12, 11 or 10

In this step, you’ll learn to import the official Microsoft repository for Visual Studio Code to ensure you get the latest version from a trusted source.

Step 1: Import Microsoft GPG Key on Debian

First, you need to import the Microsoft GPG key, which allows your system to verify the authenticity of the Visual Studio Code installation package. To do this, run the following command in your terminal:

curl -fSsL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor | sudo tee /usr/share/keyrings/vscode.gpg >/dev/null

This command downloads the GPG key from Microsoft’s server and adds it to your system’s keyring.

Step 2: Add Microsoft VSCode APT Repository on Debian

Now that you’ve imported the GPG key, the next step is to add the Visual Studio Code repository to your system. This lets you install and update Visual Studio Code directly from Microsoft’s official repository.

Run the following command in your terminal to add the repository:

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

This command adds the repository to your system’s list of package sources, making it accessible when searching for packages to install or update.

With the repository imported, you’re now ready to install Visual Studio Code on your Debian system.

Install Visual Studio Code on Debian 12, 11 or 10

Before diving into the installation process, it’s essential to understand the distinction between Visual Studio Code and Visual Studio Code Insiders, as each offers unique benefits tailored to different user needs.

  • Visual Studio Code:
    • Stable release of the editor.
    • Undergoes rigorous testing for a dependable coding experience.
    • Ideal for developers valuing stability and reliability.
  • Visual Studio Code Insiders:
    • Beta or “preview” version.
    • Offers a glimpse into upcoming features.
    • Constantly updated with new innovations.
    • It might not be as exhaustively tested as the stable version; there is potential for bugs.
    • Favored by adventurous developers or those wanting early access to features.
See also
How to Install Opera Browser on Debian 12, 11 or 10

Both versions can coexist on a system with separate installations, letting developers toggle between stable and beta environments.

Step 1: Update APT Cache Index After VSCode APT Repo Import

Before proceeding with the installation of Visual Studio Code, it’s a best practice to ensure your system’s package list is current, especially after adding a new repository:

sudo apt update

Step 2: Install Visual Studio Code on Debian via APT Command

Option 1: Install Visual Studio Code – stable build

For those who prioritize a stable and reliable coding environment, the following command will install the standard version of Visual Studio Code:

sudo apt install code

Option 2: Install Visual Studio Code – insiders build

If you’re inclined towards exploring the latest features and don’t mind the occasional bug, the Insiders version is for you. To install, use the command:

sudo apt install code-insiders

It’s worth reiterating that Visual Studio Code’s standard and insider versions are designed to operate concurrently on your Debian system. This dual-installation feature ensures developers can effortlessly transition between a stable environment and a beta testing ground, depending on their project requirements.

Launch Visual Studio Code on Debian 12, 11 or 10

With Visual Studio Code successfully installed on your Debian system, you can launch the application using various methods. Choose the approach that best suits your preferences and workflow.

CLI Commands to Launch VSCode

For those who enjoy using the terminal, you can launch Visual Studio Code quickly by entering the following command:

stable version:

code

Those that want to install the insider (beta) version:

code-insiders

Graphical User Interface (GUI) Application Launch Method

If you prefer using the desktop environment to launch applications, you can find Visual Studio Code in your system’s application menu:

  1. Click on Activities in the top-left corner of your screen.
  2. Select Show Applications (usually represented by a grid icon).
  3. Locate Visual Studio Code or Visual Studio Code Insiders in the list of applications, or use the search bar to find it.
Screenshot showing the launch interface of VSCode on Debian 13, 12, 11, or 10.
Launching VSCode on Debian’s popular versions.

First Time Tips with Visual Studio Code on Debian 12, 11 or 10

Now that you’ve installed Visual Studio Code on your Debian system, it’s time to explore some general tips, customizations, and other helpful information to help you get started with this powerful code editor.

General VSCode Tips with Debian

  • Use keyboard shortcuts: Learning and utilizing keyboard shortcuts can significantly improve your productivity. Visual Studio Code has a variety of built-in shortcuts to help you navigate, edit, and manage your code more efficiently. You can find a list of shortcuts by selecting Help > Keyboard Shortcuts Reference from the menu bar.
  • Multi-cursor editing: VSCode supports multi-cursor editing, allowing you to simultaneously make changes in multiple places. Hold the Alt key and click on different locations to create multiple cursors.
  • Integrated terminal: Visual Studio Code features an integrated terminal, enabling you to execute commands directly within the editor. To open the terminal, select View > Terminal from the menu bar or press Ctrl + ~.

VSCode Customizations with Debian

  • Themes: Personalize your editor’s appearance by choosing from a wide range of themes or creating your own. To change the theme, select File > Preferences > Color Theme from the menu bar, and pick the one that suits your taste.
  • File icons: Improve file navigation by customizing the file icons displayed in the editor. To change the file icon theme, select File > Preferences > File Icon Theme from the menu bar, and choose your preferred theme.
  • Settings: Customize your editor’s behavior by modifying settings. You can access the settings by selecting File > Preferences > Settings from the menu bar or pressing Ctrl + ,. Settings can be configured on a user or workspace level, allowing for different configurations per project.

Extensions For VSCode with Debian

Visual Studio Code’s true power lies in its extensibility. Thousands of extensions are available in the VSCode marketplace to enhance your editor’s functionality, add new features, or support additional programming languages and frameworks. To explore available extensions, select View > Extensions from the menu bar or press Ctrl + Shift + X.

Some popular extensions to consider include:

  • Live Server: Automatically launch a local development server with a live reload feature for static and dynamic pages.
  • Prettier: Automatically format your code using Prettier, a widely used code formatter supporting various languages.
  • ESLint: Detect and fix problems in your JavaScript code by integrating the ESLint linter into your editor.
  • Python: Enhance your Python development experience with rich language support, debugging, and testing features.
  • GitLens: Supercharge your Git capabilities with advanced features like blame annotations, commit search, and detailed commit information.
Confirmation screen of Visual Studio Code installation on Debian versions 13, 12, 11, and 10.
Visual Studio Code is now fully operational on Debian 12, 11, and 10.

Additional Commands for VSCode on Debian 12, 11 or 10

Remove Visual Studio Code From Debian

If you remove Visual Studio Code from your Debian system, follow the steps below to uninstall the software, remove the repository, and delete the GPG key.

See also
How to Install PHP 8.3 on Debian 12, 11 or 10

To uninstall Visual Studio Code or Visual Studio Code Insiders, run the corresponding command in your terminal:

sudo apt remove code
sudo apt remove code-insiders

After uninstalling the software, remove the Microsoft Visual Studio Code repository from your system with the following command:

sudo rm /etc/apt/sources.list.d/vscode.list

Removing the GPG key associated with the Visual Studio Code repository is a good practice for enhanced security and proper system maintenance. To do this, run the following command:

sudo rm /usr/share/keyrings/vscode.gpg

Following these steps, you’ll have successfully removed Visual Studio Code, its repository, and the GPG key from your Debian system.

Conclusion

This guide teaches you how to install Visual Studio Code on Debian using the official Microsoft repository. Following the steps ensures you have the latest software version and can keep it up-to-date. Additionally, you’ve explored some tips and customizations to help you start with Visual Studio Code and learned how to remove the software if needed.

Leave a Comment


TOC Index
Your Mastodon Instance
Share to...