How to Install VSCode on Linux Mint

Visual Studio Code provides a powerful editor for web development, Python scripting, and DevOps workflows on Linux Mint. Whether you’re building Node.js applications, managing Docker containers, or writing shell scripts, VSCode delivers intelligent code completion and integrated debugging. This guide shows you how to install VSCode on Linux Mint using Microsoft’s official APT repository for system integration or Flatpak for sandboxed isolation, including automatic updates and troubleshooting common issues. Open a terminal with Ctrl+Alt+T to get started.

Choose Your VSCode Installation Method

Linux Mint supports multiple installation methods for Visual Studio Code. The Microsoft APT repository provides direct access to stable and insiders builds with automatic updates through the system package manager, while Flatpak offers sandboxed installations with cross-distribution compatibility.

MethodChannelStabilityBest For
Microsoft APT RepositoryOfficial upstreamTested stable releasesMost users who want seamless system integration
FlatpakFlathubFrequent updatesUsers who prefer sandboxed applications

The Microsoft APT repository is recommended for most users because it integrates directly with the system and provides the fastest access to new releases. Choose Flatpak if you prefer application sandboxing or need to isolate VSCode from system dependencies.

Choose Your VSCode Build

Microsoft offers two release channels for Visual Studio Code: stable for production use and insiders for early access to new features.

BuildRelease CycleStabilityBest For
StableMonthlyTested and production-readyMost users, production work, critical projects
InsidersDailyEarly features, potential bugsExtension developers, feature testing, non-critical work

Install the stable build unless you specifically need to test upcoming features or develop VSCode extensions. The insiders build updates daily and may contain regressions that affect your workflow.

Method 1: Install Visual Studio Code via Microsoft APT Repository

Update System Packages

Before adding external repositories, refresh your package lists and upgrade existing packages:

sudo apt update && sudo apt upgrade

Install Required Dependencies

Next, install the packages needed to securely download and verify the Microsoft repository:

sudo apt install dirmngr ca-certificates software-properties-common wget gpg -y

Import Microsoft GPG Key and Repository

Now, download and install the Microsoft GPG signing key. This cryptographic key verifies that packages genuinely come from Microsoft and have not been tampered with:

wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
sudo install -D -o root -g root -m 644 microsoft.gpg /usr/share/keyrings/microsoft.gpg
rm -f microsoft.gpg

Create Repository Configuration

Create the repository configuration file using the modern DEB822 format:

cat <<EOF | sudo tee /etc/apt/sources.list.d/vscode.sources
Types: deb
URIs: https://packages.microsoft.com/repos/code
Suites: stable
Components: main
Architectures: $(dpkg --print-architecture)
Signed-By: /usr/share/keyrings/microsoft.gpg
EOF

The DEB822 .sources format provides better maintainability and scoped key management compared to legacy .list files. Linux Mint 22 (Ubuntu 24.04 base) and Linux Mint 21.x (Ubuntu 22.04 base) both support this modern format.

Install Visual Studio Code via APT

Install the HTTPS transport package, then refresh your package lists to include the new Microsoft repository:

sudo apt install apt-transport-https
sudo apt update

Generally, most users should install the stable version. However, the insiders build provides early access to new features but may contain bugs.

Option 1: VSCode Stable (Recommended)

Use the following command to install Visual Studio Code stable:

sudo apt install code

Option 2: VSCode Insiders (Pre-Release)

Alternatively, you can install the Visual Studio Code insiders build with the following command.

sudo apt install code-insiders

Verify the Installation

Confirm Visual Studio Code installed correctly by checking the version:

code --version

You should see output displaying the version number, commit hash, and architecture:

1.95.3
f1a4fb101478ce6ec82fe9627c43efbf9e98c813
x64

Method 2: Install Visual Studio Code via Flatpak and Flathub

As an alternative, Flatpak provides a sandboxed method for installing Visual Studio Code on your Linux Mint system. By default, Flatpak is pre-installed on Linux Mint desktops.

Enable Flathub Repository

Although Linux Mint includes Flatpak by default, you may need to enable the Flathub repository if not already configured:

sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

Linux Mint ships with Flatpak pre-installed. If you need the latest Flatpak version, see our guide on upgrading Flatpak on Linux Mint.

Install VSCode from Flathub

Install Visual Studio Code system-wide from the Flathub repository:

flatpak install --system flathub com.visualstudio.code -y

Verify the installation by listing installed Flatpak applications:

flatpak list --app | grep -i code

Expected output:

Visual Studio Code	com.visualstudio.code	1.95.3	stable	system

Launch Visual Studio Code

Once the installation is complete, you can open VSCode using either the terminal or the graphical applications menu.

Launch from Terminal

After installing via APT, launch VSCode by typing:

code

If you installed the insiders build instead, use this command:

code-insiders

Flatpak installations require the full application ID:

flatpak run com.visualstudio.code

Additionally, you can open a specific folder or file directly:

code ~/Projects/my-project

Launch from Applications Menu

Alternatively, desktop users who prefer a graphical approach can open VSCode through the applications menu by following this path:

Taskbar > Programming > Visual Studio Code {Version}

Update and Maintain Visual Studio Code

Update VSCode

Since VSCode updates through your system package manager, checking for updates is straightforward. Run the following command to update all APT packages including VSCode:

sudo apt update && sudo apt upgrade

Similarly, Flatpak installations receive updates through their own update mechanism:

flatpak update

Remove VSCode

If you decide to uninstall Visual Studio Code, use the command that matches your original installation method.

Remove APT Installation

First, uninstall VSCode and optionally remove the insiders build:

sudo apt remove code code-insiders

Next, remove the Microsoft repository and GPG key to complete the cleanup:

sudo rm /etc/apt/sources.list.d/vscode.sources
sudo rm /usr/share/keyrings/microsoft.gpg

Remove Flatpak Installation

For Flatpak installations, run the uninstall command:

flatpak uninstall com.visualstudio.code

Remove User Configuration Data

The following commands permanently delete your VSCode settings, extensions, and workspace data. Therefore, export any settings or snippets you want to keep before proceeding.

To completely remove VSCode configuration directories from APT installations:

rm -rf ~/.config/Code
rm -rf ~/.vscode
rm -rf ~/.cache/Code

Likewise, for Flatpak installations, remove the sandboxed data directory:

rm -rf ~/.var/app/com.visualstudio.code

Troubleshoot Common Issues

The following troubleshooting steps apply to Linux Mint 21.x and 22 (Ubuntu 22.04/24.04 base) with VSCode installed via APT or Flatpak.

GPG Key Errors During apt update

Occasionally, when running sudo apt update, you may encounter a GPG signature error:

W: GPG error: https://packages.microsoft.com/repos/code stable InRelease: 
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY EB3E94ADBE1229CF

This error occurs when the Microsoft GPG key is missing or corrupted. To diagnose the issue, verify the key exists:

ls -la /usr/share/keyrings/microsoft.gpg

Expected output when key exists:

-rw-r--r-- 1 root root 2451 Nov 29 10:30 /usr/share/keyrings/microsoft.gpg

If the file is missing or you see a “No such file” error, you need to re-import the key:

wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
sudo install -D -o root -g root -m 644 microsoft.gpg /usr/share/keyrings/microsoft.gpg
rm -f microsoft.gpg

Finally, verify the fix by running apt update without errors:

sudo apt update

File Watcher Limit Reached

When working with large projects containing many files, you may see this notification in VSCode:

Visual Studio Code is unable to watch for file changes in this large workspace. Please follow the instructions link to resolve this issue.

First, check your current inotify watcher limit:

cat /proc/sys/fs/inotify/max_user_watches

Expected output showing default limit:

8192

The default is often 8192 or 65536, which may be insufficient for large projects. To increase it permanently:

echo "fs.inotify.max_user_watches=524288" | sudo tee -a /etc/sysctl.conf
sudo sysctl -p

Expected output from sysctl -p:

fs.inotify.max_user_watches = 524288

Afterward, verify the new limit is active:

cat /proc/sys/fs/inotify/max_user_watches
524288

Conclusion

You now have Visual Studio Code running on Linux Mint with GPG-verified repositories and automatic updates through APT or Flatpak. The GPG key import and DEB822 repository configuration covered here ensure secure, maintainable package management. Extend your development environment by installing Git for version control, GitHub Desktop on Linux Mint for GUI workflows, or VSCodium on Linux Mint for a telemetry-free alternative.

3 thoughts on “How to Install VSCode on Linux Mint”

Leave a Comment