Visual Studio Code (VS Code) is a powerful and versatile code editor developers worldwide love. Installing it on Linux is a straightforward process that can be accomplished in just a few simple steps.
If you’re using Debian 12 “Bookworm” as your operating system and want to harness the full potential of this powerful code editor, you’ve come to the right place!
This comprehensive guide will walk you through the step-by-step process of installing Visual Studio Code on Debian 12, empowering you to elevate your coding experience to new heights.
In addition, we will also show you how to install it as a Flatpak package, a widely adopted Linux community software distribution format.
Which of the two methods to choose? Well, it is entirely up to you. However, our recommendation is to stick with the native DEB format. So, let’s get started!
Install Visual Studio Code on Debian 12 “Bookworm”
This guide will use the
sudo command and assuming you have sudo privileges.
1. Install Prerequisites
Before we begin the installation, we must install some packages that will be required to be available on our Debian 12 system for the next steps.
To accomplish this, type the following APT commands to update the package base and install prerequisites:
sudo apt update
sudo apt install software-properties-common apt-transport-https wget gpg
2. Import Microsoft’s GPG Key
To ensure that the packages we receive to install the Visual Studio Code are genuine, we should download and import the Microsoft signed GPG keys on our Debian 12 system.
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 /usr/share/keyrings/packages.microsoft.gpg
Notice that none of the commands generate output.
3. Add Microsoft’s Visual Studio Code Repository
After importing Microsoft’s GPG keys, we’ll add the official Visual Studio Code repository to our Debian 12 system. This implies that the update package will be made available with the rest of your system’s regular updates if a new version is released.
To accomplish it, type the command shown below.
sudo sh -c 'echo "deb [arch=amd64,arm64,armhf signed-by=/usr/share/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" > /etc/apt/sources.list.d/vscode.list'
4. Run System Update
Before we proceed with VS Code installation on our Debian 12 system, we should update the list of available packages. So, run the below command to update Debian’s repositories index.
sudo apt update
5. Install VS Code on Ubuntu 22.04
Everything is already prepared for the actual installation. To install VS Code on our Debian 12 “Bookworm” system, run the following command and wait for the installation to complete.
sudo apt install code
6. Run Visual Studio Code on Debian 12
You can start using VS Code by launching it from the desktop application menu. Search for “code,” and when its icon appears, click to run the same.
When you start VS Code for the first time, a window like the following should appear:
When setting up your interface, you will be asked to choose a theme and have the ability to personalize your IDE to match your preferences.
For example, you can modify font size, color scheme, and layout settings. Furthermore, you can install extensions that expand the IDE’s capabilities and features.
Doing so will allow you to customize your development environment according to your requirements, making your coding experience more efficient and enjoyable.
Uninstall VS Code
If you uninstall Visual Studio Code from your Debian system for any reason, you can do it easily by running the provided command below:
sudo apt remove code
Install Visual Studio Code as Flatpak
Important notice: Remember that VS Code’s Flatpak version runs inside a container and cannot access SDKs on your host system!
Another way to install VS Code on Debian 12 is using Flatpak, a universal packaging format that simplifies software distribution across different distributions.
However, if you don’t have Flatpak support added to your system, don’t worry. We’ve got you covered, and you can learn how to do it quickly and easily with our comprehensive guide on the subject.
First, add Flatpak support to your Debian 12 system:
sudo apt install flatpak
Then, enable the Flathub repository:
sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
Finally, run the following to install Visual Studio Code on your Debian 12 system as Flatpak:
flatpak install flathub com.visualstudio.code
Now, log out, log back in, and find and run VS Code from the list of the app launcher you are using.
In this guide, we have explored two different methods to install Visual Studio Code on Debian 12: as a native DEB package and using Flatpak. Each approach offers its own set of advantages, catering to users’ diverse needs and preferences.
For users seeking a straightforward and traditional installation process, the native DEB package method is the way to go. Leveraging Debian’s package manager, users can effortlessly install VS Code and benefit from system-wide integration, regular updates, and a seamless user experience.
On the other hand, the Flatpak approach appeals to those who prioritize application sandboxing and independent version management.
With your installation complete, you are ready to embark on a coding journey with Visual Studio Code, unleashing the true potential of your projects and streamlining your development workflow.
Thanks for your time! If you have any questions, please leave them in the comments section below. To learn more about Visual Studio Code, visit its official documentation page.