code.visualstudio.com

Visual Studio Code is available on Linux through official Debian, RPM, and Snap packages. Community-maintained packages are also available for Arch Linux and Nix.

Install VS Code on Linux

Choose the package method that matches your Linux distribution.

Debian and Ubuntu-based distributions
  1. Download the .deb package.

  2. Install the package with the graphical software center, or install it from the command line:

    echo "code code/add-microsoft-repo boolean true" | sudo debconf-set-selections
    

    To manually install the apt repository:

    1. Install the signing key:

      Types: deb
      URIs: https://packages.microsoft.com/repos/code
      Suites: stable
      Components: main
      Architectures: amd64,arm64,armhf
      Signed-By: /usr/share/keyrings/microsoft.gpg
      
    2. Update the package cache and install the package:

      sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc &&
      echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\nautorefresh=1\ntype=rpm-md\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" | sudo tee /etc/yum.repos.d/vscode.repo > /dev/null
      
    3. Update the package cache and install the package with dnf on Fedora 22 and later:

      yum check-update &&
      sudo yum install code # or code-insiders
      

    Note

    Due to the manual signing process and publishing system, the yum repository could lag behind by up to three hours and not immediately contain the latest version of VS Code.

    Snap package

    VS Code is officially distributed as a Snap package in the Snap Store.

    Get it from the Snap Store

    Install the Snap package with this command:

    sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc &&
    echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\nautorefresh=1\ntype=rpm-md\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" | sudo tee /etc/zypp/repos.d/vscode.repo > /dev/null
    
  3. Update the package cache and install the package:

    nix-env -i vscode
    
Manual RPM package

Download and install the VS Code .rpm package manually when repository installation is not available. Auto-update does not work unless the repository is installed.

Install the downloaded .rpm package with your package manager, for example with dnf:

xdg-mime default code.desktop text/plain

Debian alternatives system

Debian-based distributions support setting a default editor through the Debian alternatives system, without concern for the MIME type. Set VS Code as the default editor with this command:

sudo update-alternatives --set editor /snap/bin/code

If VS Code doesn't show up as an alternative to the default editor, register it:

# For .deb
sudo apt-get update

# For .rpm on Fedora 21 and earlier
sudo yum check-update

# For .rpm on Fedora 22 and later
sudo dnf check-update
Conflicts with VS Code packages from other repositories

Some distributions, such as Pop!_OS, provide their own code package. To ensure that the official VS Code repository is used, create a file named /etc/apt/preferences.d/code with this content:

sudo apt-get install gvfs libglib2.0-bin
"Visual Studio Code is unable to watch for file changes in this large workspace" (error ENOSPC)

This notification indicates that the VS Code file watcher is running out of file handles. This often happens when opening a workspace that contains many files. Before adjusting platform limits, add large folders, such as Python .venv, to the files.watcherExclude setting. Other running applications might also consume file handles, so closing other applications might help.

View the current limit by running:

fs.inotify.max_user_watches=524288

Load the new value:

"files.watcherExclude": {
    "**/.git/objects/**": true,
    "**/.git/subtree-cache/**": true,
    "**/node_modules/*/**": true
}
I can't see Chinese characters in Ubuntu

Open the application menu, then choose File > Preferences > Settings. In the Text Editor > Font section, set Font Family to Droid Sans Mono, Droid Sans Fallback.

To edit the settings.json file directly, set editor.fontFamily :

# Install
sudo apt-get update
sudo apt-get install compizconfig-settings-manager

# Run
ccsm

Under General > General Options > Focus & Raise Behavior, set Focus Prevention Level to Off. This operating system setting applies to all applications, not only VS Code.

Cannot install .deb package due to "/etc/apt/sources.list.d/vscode.list: No such file or directory"

This error can occur when sources.list.d doesn't exist or the current user doesn't have access to create the file. Create the folder and an empty vscode.list file:

E: Repository '...' changed its 'Origin' value from '...' to '...'
N: This must be accepted explicitly before updates for this repository can be applied. See apt-secure(8) manpage for details.

Use apt instead of apt-get and accept the origin change when prompted:

">sudo apt update

8/12/2026

Read the original on code.visualstudio.com ↗