How to Install Visual Studio Code on Linux Mint (22, 21)

Last updated Wednesday, April 22, 2026 1:16 pm Joshua James 7 min read 3 comments

Linux Mint is a comfortable place to write code, and Visual Studio Code still covers the common stack without pushing you into a heavier IDE. You can install Visual Studio Code on Linux Mint with Microsoft’s APT repository for the normal code launcher or with Flatpak if you prefer a sandboxed build.

These steps work on Linux Mint 22.x and 21.x across Cinnamon, MATE, and Xfce. If you came here to download VS Code for Linux Mint, Microsoft still publishes the official .deb on the Visual Studio Code download page, but the repository method is the better long-term choice because updates stay inside APT.

Install Visual Studio Code on Linux Mint

The Microsoft APT repository is the better default for most Linux Mint systems because it installs the standard code command and keeps updates in your normal package workflow. Flatpak is the better fit when you want the sandbox more than deep host integration.

MethodChannelStabilityBest For
Microsoft APT repositoryMicrosoft Linux repositoryOfficial stable buildsMost users who want the standard code launcher and APT-managed updates
FlatpakFlathubCommunity repackagingUsers who prefer a sandboxed build

If you want the same editor without Microsoft’s telemetry, install VSCodium on Linux Mint instead. It tracks the VS Code interface closely, but it is a separate build and follows its own release cadence.

Install Visual Studio Code via Microsoft APT Repository on Linux Mint

Microsoft’s repository is the path to use when you want the regular Linux Mint package workflow and the host-side code launcher. The same stable repository currently installs cleanly on Linux Mint 22.x and 21.x.

Update System Packages Before Installing VS Code

Open a terminal from the applications menu and refresh your package lists before adding external repositories:

sudo apt update && sudo apt upgrade

These commands use sudo for system changes. If your account is not in the sudoers file yet, follow the guide to create and add users to sudoers on Linux Mint before continuing.

Install Required Packages for VS Code

Install the packages needed to download Microsoft’s signing key and write the repository configuration:

sudo apt install ca-certificates wget gpg -y

Import the Microsoft VS Code GPG Key

Download Microsoft’s signing key so APT can verify packages from the VS Code repository:

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

Microsoft publishes this key in ASCII-armored format. gpg --dearmor converts it to the binary keyring APT expects, and --yes prevents overwrite prompts if you rerun the command later.

Create the VS Code Repository File

Add the Microsoft repository with a DEB822 .sources file so the signing key stays tied to this repository instead of being trusted system-wide:

printf '%s\n' \
'Types: deb' \
'URIs: https://packages.microsoft.com/repos/code' \
'Suites: stable' \
'Components: main' \
"Architectures: $(dpkg --print-architecture)" \
'Signed-By: /usr/share/keyrings/microsoft.gpg' | sudo tee /etc/apt/sources.list.d/vscode.sources > /dev/null

The tee command writes the root-owned file because a plain > redirection would still run as your normal user account. $(dpkg --print-architecture) inserts the correct architecture automatically, which is usually amd64 on current Linux Mint desktops.

Install Visual Studio Code

Refresh APT, then install the exact package name Linux Mint expects: code.

sudo apt update
sudo apt install code -y

Microsoft also publishes an insiders build for early testing. Install it only if you specifically need preview features or extension-development testing:

sudo apt install code-insiders -y

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, and each keeps its own settings and extensions.

Verify the VS Code APT Installation

Use the package manager and launcher path instead of the GUI version flag. This confirms both the installed package name and the host-side command.

dpkg-query -W code
command -v code

Relevant output includes:

code	1.116.0-1776214182
/usr/bin/code

The version string changes regularly. What matters is that the package appears as code and the launcher resolves to /usr/bin/code.

Install Visual Studio Code via Flatpak on Linux Mint

The Flathub build keeps VS Code inside a Flatpak sandbox and avoids adding Microsoft’s APT repository. It is a community-maintained repackaging, so choose it when the sandbox matters more than full system integration.

Verify the Flathub Remote for VS Code

Standard Linux Mint desktop installs already include Flatpak with Flathub enabled at system scope. Re-add the remote only if it was removed or this system was customized:

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

Confirm the remote exists and note the system scope:

flatpak remotes
flathub system

Most Linux Mint desktops will already show flathub system. If your machine was customized and the remote is missing, the previous command adds it back.

If you need the latest Flatpak version for compatibility with newer applications, see how to upgrade Flatpak on Linux Mint.

Install VS Code from Flathub

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

sudo flatpak install flathub com.visualstudio.code -y

The -y flag accepts the install prompt automatically. Flatpak pulls the application plus any required runtimes in the same step.

Verify the VS Code Flatpak Installation

Use flatpak info to confirm the app ID, branch, version, and system scope:

flatpak info com.visualstudio.code

Relevant output includes:

Visual Studio Code - Code editing. Redefined.

          ID: com.visualstudio.code
         Ref: app/com.visualstudio.code/x86_64/stable
        Arch: x86_64
      Branch: stable
     Version: 1.116.0
      Origin: flathub
Installation: system

The Flatpak build does not add a host-side code command. Launch it with flatpak run com.visualstudio.code from the terminal or from the applications menu.

Launch Visual Studio Code on Linux Mint

APT and Flatpak do not expose the same terminal command, so use the launcher that matches your installation method. The applications menu works for both.

Launch VS Code from the Terminal

The APT installation uses the standard launcher:

code

If you installed the insiders build instead, use:

code-insiders

The Flatpak build uses the application ID instead of a host-side code command:

flatpak run com.visualstudio.code

For the APT build, you can also open a specific folder directly by appending the path:

code ~/Projects/my-project

Passing a directory path opens that folder as a workspace, skipping the file browser entirely.

Launch VS Code from the Applications Menu

From the desktop, open VS Code through the applications menu:

Menu > Programming > Visual Studio Code

Update Visual Studio Code on Linux Mint

VS Code ships frequent updates, and the right command depends on how you installed it.

Update VS Code via APT

APT-managed installs update alongside your other packages:

sudo apt update && sudo apt upgrade

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

sudo apt install --only-upgrade code -y

Update VS Code via Flatpak

Keep the Flathub build at the same system scope Linux Mint uses by default:

sudo flatpak update com.visualstudio.code -y

Remove Visual Studio Code from Linux Mint

Match the removal commands to your original installation method. A complete cleanup removes the application itself, the repository or Flatpak registration, and any optional per-user settings you no longer want to keep.

Remove the VS Code APT Installation

Remove the main package and the insiders build if you installed it:

sudo apt remove -y code code-insiders

Then clean up dependencies that were installed only for this package:

sudo apt autoremove -y

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
sudo apt update

Verify that both the package and the repository source are gone:

dpkg-query -W code 2>/dev/null || echo "code package is not installed"
apt-cache policy code | sed -n '1,4p'
code package is not installed
code:
  Installed: (none)
  Candidate: (none)

Remove the VS Code Flatpak Installation

Remove the app itself first:

sudo flatpak remove com.visualstudio.code -y

Then clean up runtimes no longer used by other Flatpak apps:

sudo flatpak uninstall --unused -y

Linux Mint usually keeps Flathub at system scope, so use sudo for both commands.

Confirm the Flatpak app is gone before removing the per-user sandbox data:

flatpak list --app --columns=application | grep -Fx com.visualstudio.code || echo "VS Code Flatpak is not installed"
VS Code Flatpak is not installed

Remove VS Code User Configuration Data

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

To remove the user configuration directories from an APT installation:

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 VS Code Issues on Linux Mint

These are the Linux Mint issues most likely to change the install or daily workflow for VS Code, especially when you switch between the APT and Flatpak builds.

Fix VS Code GPG Key Errors on Linux Mint

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

The key file is either missing or corrupted. Check whether it exists:

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

If the key is present, ls prints a normal file listing for /usr/share/keyrings/microsoft.gpg. If the file is missing, the command returns a “No such file or directory” error and you can go straight to the re-import step.

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 --yes -o /usr/share/keyrings/microsoft.gpg

Confirm the fix with a clean apt update:

sudo apt update

Raise the VS Code File Watcher Limit on Linux Mint

Large projects, especially ones with heavy node_modules trees, can exhaust Linux’s default file watcher limit and trigger this VS Code warning:

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

Linux caps the number of filesystem watchers per user, and large projects can blow past that limit. Check your current cap:

cat /proc/sys/fs/inotify/max_user_watches

Defaults vary (8192, 65536, or 524288) depending on your kernel version. If your project has more files than this number, VS Code stops tracking changes.

To increase the limit permanently, add a sysctl configuration:

printf '%s\n' 'fs.inotify.max_user_watches=524288' | sudo tee /etc/sysctl.d/60-inotify-watches.conf > /dev/null
sudo sysctl --system

tee writes the root-owned file because a plain > redirection would still run as your regular user account. Using a dedicated file in /etc/sysctl.d/ keeps this change separate from the rest of the system defaults.

Verify the new limit is active:

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

Restart VS Code after applying the new limit. The warning should disappear for most projects once the editor reloads.

Fix VS Code Flatpak Terminal Access on Linux Mint

The Flatpak build runs inside a sandbox, so the integrated terminal may miss host compilers, SDKs, or custom environment variables that the APT build can already see.

Grant host filesystem access for your own account if you need the Flatpak build to see the rest of the system:

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

The app can stay installed system-wide while the override applies only to your own account. If you need regular access to host compilers, SDKs, and shell variables, the APT build is still the smoother option.

Conclusion

VS Code is installed on Linux Mint with the workflow that fits your setup, either the full APT path or the sandboxed Flatpak build. Install Git on Linux Mint next if you want the normal version-control baseline. For a graphical workflow, install GitHub Desktop on Linux Mint. If you want the same editor without Microsoft’s telemetry, install VSCodium on Linux Mint instead.

Search LinuxCapable

Need another guide?

Search LinuxCapable for package installs, commands, troubleshooting, and follow-up guides related to what you just read.

Found this guide useful?

Support LinuxCapable to keep tutorials free and up to date.

Buy me a coffee Buy me a coffee

3 thoughts on “How to Install Visual Studio Code on Linux Mint (22, 21)”

Before commenting, please review our Comments Policy.
Formatting tips for your comment

You can use basic HTML to format your comment. Useful tags currently allowed in published comments:

You type Result
<code>command</code> command
<strong>bold</strong> bold
<em>italic</em> italic
<blockquote>quote</blockquote> quote block

Got a Question or Feedback?

We read and reply to every comment - let us know how we can help or improve this guide.

Let us know you are human: