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, with coverage of automatic updates and troubleshooting common issues.

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

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

The Microsoft repository uses a universal package format that works across all current Linux Mint releases, including 21.x (Ubuntu 22.04 base) and 22.x (Ubuntu 24.04 base). The steps in this guide are identical for both versions.

Method 1: Install Visual Studio Code via Microsoft APT Repository

The Microsoft APT repository provides the most direct way to install and update VSCode. This method installs VSCode system-wide and keeps it updated alongside your other system packages.

Update System Packages

Before adding external repositories, open a terminal from the applications menu or by pressing the keyboard shortcut configured on your system. Then refresh your package lists and upgrade existing packages to ensure a clean installation environment:

sudo apt update && sudo apt upgrade

Install Required Dependencies

Next, install the packages needed to securely download and verify the Microsoft repository. These include wget for downloading the GPG key and gpg for converting it to binary format:

sudo apt install ca-certificates wget gpg -y

Import Microsoft GPG Key

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 during transit:

wget -qO- https://packages.microsoft.com/keys/microsoft.asc | sudo gpg --dearmor -o /usr/share/keyrings/microsoft.gpg

This single command downloads the ASCII-armored key, converts it to binary format using gpg --dearmor, and writes it directly to the system keyrings directory. The -o flag specifies the output location, avoiding the need for temporary files in your working directory.

Create Repository Configuration

Create the repository configuration file using the modern DEB822 format. This format provides better maintainability and scoped key management compared to legacy .list files:

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 $(dpkg --print-architecture) command automatically detects your system architecture (typically amd64 for 64-bit systems), ensuring the correct packages are fetched.

During installation, VSCode adds a header comment to this file noting that it is “automatically configured.” This is normal behavior; the file remains functional and does not conflict with your manual configuration.

Install Visual Studio Code

Refresh your package lists to include the new Microsoft repository, then install VSCode:

sudo apt update
sudo apt install code

Microsoft also offers an insiders build for users who want early access to new features. The insiders build updates daily and may contain experimental features or regressions. Install it only if you specifically need to test upcoming features or develop VSCode extensions:

sudo apt install code-insiders

You can install both code and code-insiders side by side. The stable build runs with the code command, while the insiders build runs with code-insiders. Settings and extensions are stored separately, so you can switch between them without conflicts.

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.107.1
f1a4fb101478ce6ec82fe9627c43efbf9e98c813
x64

The three lines confirm: the version number (updates monthly), the Git commit hash of the build, and your system architecture. If this output matches the expected format, VSCode is ready to use.

Method 2: Install Visual Studio Code via Flatpak

Flatpak provides a sandboxed installation method that isolates VSCode from your system libraries. This approach is useful if you want to keep VSCode separate from system dependencies or prefer the Flatpak ecosystem for managing desktop applications.

Verify Flathub Repository

Linux Mint includes Flatpak with Flathub enabled by default on all desktop editions, so this step is usually unnecessary. The following command verifies the Flathub repository is configured, adding it only if somehow missing:

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

On most Linux Mint systems, this command will report that the remote already exists. If you’re running a minimal installation or have previously removed Flathub, the command adds it back.

If you need the latest Flatpak version for compatibility with newer applications, see our guide on upgrading Flatpak on Linux Mint.

Install VSCode from Flathub

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

sudo flatpak install flathub com.visualstudio.code -y

The -y flag automatically confirms the installation prompts. Flatpak downloads the application and any required runtime dependencies (such as the freedesktop platform).

Verify the Installation

Confirm the installation succeeded by listing installed Flatpak applications:

flatpak list --app | grep -i code

Expected output:

Visual Studio Code	com.visualstudio.code	1.107.0	stable	system

The output shows the application name, Flatpak ID, version, branch, and installation scope. The system scope indicates the application is available to all users on the machine.

The Flatpak version of VSCode is a community repackaging, not officially supported by Microsoft. Some features requiring deep system integration (like the integrated terminal accessing system tools) may have limitations. Refer to the Flathub page for configuration notes specific to the Flatpak version.

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:

code-insiders

Flatpak installations require the full application ID when launching from the terminal:

flatpak run com.visualstudio.code

You can also open a specific folder or file directly by passing the path as an argument:

code ~/Projects/my-project

This is particularly useful for quickly opening project directories from the terminal without navigating through the file browser.

Launch from Applications Menu

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

Menu > Programming > Visual Studio Code

Update Visual Studio Code

Keeping VSCode updated ensures you have the latest features, security patches, and bug fixes. The update method depends on how you installed the application.

Update APT Installation

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

For a targeted update that only upgrades VSCode without touching other packages, use:

sudo apt install --only-upgrade code

Update Flatpak Installation

Flatpak installations receive updates through their own update mechanism. Update all Flatpak applications including VSCode with:

sudo flatpak update

Remove Visual Studio Code

If you decide to uninstall Visual Studio Code, use the commands that match your original installation method. Complete removal includes the application, repository configuration, and optionally your personal settings.

Remove APT Installation

First, uninstall VSCode and optionally the insiders build:

sudo apt remove code code-insiders

Next, remove any orphaned dependencies that were installed alongside VSCode:

sudo apt autoremove

Finally, 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:

sudo flatpak uninstall com.visualstudio.code

Flatpak may prompt you to remove unused runtimes. You can clean up orphaned runtimes with:

sudo flatpak uninstall --unused

Remove User Configuration Data

The following commands permanently delete your VSCode settings, extensions, and workspace data. Export any settings or snippets you want to keep before proceeding. VSCode stores settings in JSON files under ~/.config/Code/User/, which you can back up manually.

To completely remove VSCode configuration directories from APT installations:

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

For the insiders build, remove its separate configuration directories:

rm -rf ~/.config/Code\ -\ Insiders
rm -rf ~/.vscode-insiders

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.x (Ubuntu 22.04/24.04 base) with VSCode installed via APT or Flatpak.

GPG Key Errors During apt update

When running sudo apt update, you may occasionally 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, first verify whether the key exists:

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

Expected output when the key exists:

-rw-r--r-- 1 root root 2451 Dec 15 12:30 /usr/share/keyrings/microsoft.gpg

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

wget -qO- https://packages.microsoft.com/keys/microsoft.asc | sudo gpg --dearmor -o /usr/share/keyrings/microsoft.gpg

Verify the fix by running apt update without errors:

sudo apt update

File Watcher Limit Reached

When working with large projects containing many files (such as Node.js projects with extensive node_modules directories), 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.

This occurs because Linux limits the number of file system watchers a user can create. First, check your current inotify watcher limit:

cat /proc/sys/fs/inotify/max_user_watches

Common default values are 8192, 65536, or 524288 depending on your distribution and kernel version. If your project contains more files than this limit, VSCode cannot track all changes.

To increase the limit permanently, add a sysctl configuration:

echo "fs.inotify.max_user_watches=524288" | sudo tee /etc/sysctl.d/60-inotify-watches.conf
sudo sysctl --system

This approach creates a dedicated configuration file in /etc/sysctl.d/ rather than appending to /etc/sysctl.conf, which is the recommended method for modern systemd-based distributions.

Verify the new limit is active:

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

Restart VSCode for the change to take effect. The file watcher warning should no longer appear for most projects.

Flatpak Terminal Integration Issues

The Flatpak version of VSCode runs in a sandbox, which can cause the integrated terminal to behave differently than expected. Common issues include missing system tools or incorrect environment variables.

To allow the Flatpak version to access host system tools, grant file system permissions:

flatpak override --user --filesystem=host com.visualstudio.code

For development workflows requiring access to system SDKs or compilers, the APT installation method generally provides better integration than Flatpak.

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

Let us know you are human: