Ninja Docs Help

Installation: Linux

Revision

Date

Description

1.0

24.07.2024

Init Changelog

Introduction

See the Download Visual Studio Code page for complete list of available installation options.

By downloading and using Visual Studio Code, you agree to the license terms and privacy statement.

  1. Debian and Ubuntu based distributions

  2. RHEL, Fedora, and CentOS based distributions

  3. Snap

  4. Installing .rpm package manually

  5. Troubleshooting

Debian and Ubuntu based distributions

The easiest way to install Visual Studio Code for Debian/Ubuntu based distributions is to download and install the .deb package (64-bit), either through the graphical software center if it's available, or through the command line with:

sudo apt install ./<file>.deb # If you're on an older Linux distribution, you will need to run this instead: # sudo dpkg -i <file>.deb # sudo apt-get install -f # Install dependencies

Note that other binaries are also available on the VS Code download page.

Installing the .deb package will automatically install the apt repository and signing key to enable auto-updating using the system's package manager. Alternatively, the repository and key can also be installed manually with the following script:

sudo apt-get install wget gpg 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 /etc/apt/keyrings/packages.microsoft.gpg echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" |sudo tee /etc/apt/sources.list.d/vscode.list > /dev/null rm -f packages.microsoft.gpg

Then update the package cache and install the package using:

sudo apt install apt-transport-https sudo apt update sudo apt install code # or code-insiders

RHEL, Fedora, and CentOS based distributions

We currently ship the stable 64-bit VS Code in a yum repository, the following script will install the key and repository:

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\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" | sudo tee /etc/yum.repos.d/vscode.repo > /dev/null

Then update the package cache and install the package using dnf (Fedora 22 and above):

dnf check-update sudo dnf install code # or code-insiders

Or on older versions using yum:

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

Snap

Visual Studio Code is officially distributed as a Snap package in the Snap Store:

snap-store.png

You can install it by running:

sudo snap install --classic code # or code-insiders

Once installed, the Snap daemon will take care of automatically updating VS Code in the background. You will get an in-product update notification whenever a new update is available.

Learn more about snaps from the official Snap Documentation.

Installing .rpm package manually

The VS Code .rpm package (64-bit) can also be manually downloaded and installed, however, auto-updating won't work unless the repository above is installed. Once downloaded it can be installed using your package manager, for example with dnf:

sudo dnf install <file>.rpm

Note that other binaries are also available on the VS Code download page.

Troubleshooting

Missing root privileges on system with GNOME

If some security idiots have decided to block and complicate the installation of essential work tools (like VSC) and are also unwilling to provide up-to-date versions of the software in the company repositories, it might be necessary to manually install the package in your home directory. To do this, follow the instructions below:

  1. Download .rpm package.

  2. Go to Download directory and run rpm2cpio code-*.rpm | cpio -idv.

  3. Check extracted files and move it to your local PATH directory (like ~/.local/).

  4. Create symlink to code binary (it exists in extracted files at share/code/bin/code): ln -s <path_to_binary> code.

  5. Modify code.desktop and code-url-handler.desktop files located in share/applications directory.

    1. Change every Exec to absolute path for share/code/code file.

    2. Change every Icon to absolute path for share/pixmaps/vscode.png file.

  6. Restart GNOME (ALT + F2-> r-> Enter or killall -3 gnome-shell from command line).

Last modified: 17 February 2025