Microsoft builds an official RPM package of Visual Studio Code and serves it from its own repository, so the editor installs and updates through dnf like any other system package. One repository covers the whole Red Hat family: RHEL, Rocky Linux, AlmaLinux, CentOS Stream, and Oracle Linux all pull the same signed build.
This guide replaces our old CentOS instructions with the current repository setup, then goes further than the basic install: managing extensions from the terminal, keeping the editor updated, an offline install path, and clean removal. Every command below was tested on Rocky Linux 10.1 and 9.7 in August 2026, with VS Code 1.132.0 landing from the repository on both.
Add the Microsoft Repository
Two pieces make the repository trusted: the GPG key that signs the packages, and a repo definition pointing dnf at Microsoft’s server. Import the key first:
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
Then write the repository file. This is the current definition from the official VS Code Linux setup docs, including the autorefresh and type fields that older guides floating around tend to miss:
printf '[code]
name=Visual Studio Code
baseurl=https://packages.microsoft.com/yumrepos/vscode
enabled=1
autorefresh=1
type=rpm-md
gpgcheck=1
gpgkey=https://packages.microsoft.com/keys/microsoft.asc
' | sudo tee /etc/yum.repos.d/vscode.repo
tee echoes what it wrote, so you get instant confirmation of the file contents. Check that dnf now sees the repo:
dnf repolist
The code repository sits alongside the distribution’s own:
repo id repo name
appstream Rocky Linux 10 - AppStream
baseos Rocky Linux 10 - BaseOS
code Visual Studio Code
extras Rocky Linux 10 - Extras
Fedora reads from this same Microsoft repository, though the surrounding steps differ slightly; the install VS Code on Fedora guide covers that side.
Install VS Code
The package is named code:
sudo dnf install code
On a fresh minimal server the transaction runs long because dnf pulls in the desktop libraries the editor links against. A workstation with a desktop environment already present gets a far smaller list. This was the transaction on a minimal install:
Installing:
code x86_64 1.132.0-1785860072.el8 code 333 M
Transaction Summary
================================================================
Install 158 Packages
Total download size: 433 M
Installed size: 1.4 G
The release string is a detail that confuses people: the package carries an el8 suffix on every release in the family. Microsoft compiles a single build against the oldest glibc it supports and ships that everywhere, so el8 on a newer system is expected, not a packaging mistake. Query the installed package:
rpm -qi code
The output names the exact build and install date:
Name : code
Version : 1.132.0
Release : 1785860072.el8
Architecture: x86_64
Install Date: Tue 11 Aug 2026 04:23:17 PM UTC
Size : 1076766765
License : Multiple, see https://code.visualstudio.com/license
Source RPM : code-1.132.0-1785860072.el8.src.rpm
The same repository also carries the daily Insiders channel as a separate code-insiders package, which installs alongside stable without conflict. Verify the editor binary answers before launching anything graphical:
code --version
Three lines come back: the version, the git commit it was built from, and the architecture:
1.132.0
df53daabb18cd157bdb08c7f01c34df936cf12f4
x64
Launch VS Code
Start it from the Activities overview, or from any terminal:
code
First launch walks through a short setup: a GitHub sign-in prompt for Copilot, which you can dismiss with Continue without Signing In, followed by a theme picker. After that you land on the welcome screen:

In day-to-day use you will mostly open the editor onto a directory rather than empty:
code .
code ~/projects/api
Help, then About, confirms the exact build along with the Electron, Chromium, and Node.js versions it embeds:

If the first thing you do in a new editor is pull a project down, the built-in Git integration handles that without leaving the welcome screen; we cover the flow in cloning a Git repository from GitHub in VS Code.
Install Extensions From the Terminal
The code binary manages extensions without the editor open, which is the fastest way to script a new workstation or bake extensions into a dotfiles setup. Install the Python extension by its marketplace ID:
code --install-extension ms-python.python
Dependencies come along automatically. One extension in the command turned into three on disk:
Extension 'ms-python.debugpy' v2026.6.0 was successfully installed.
Extension 'ms-python.python' v2026.4.0 was successfully installed.
Extension 'ms-python.vscode-pylance' v2026.3.1 was successfully installed.
Audit what is installed at any point:
code --list-extensions --show-versions
Each line is ready to feed back into an install command on another machine:
[email protected]
[email protected]
[email protected]
[email protected]
Keep VS Code Updated
This is the payoff of the repository method: updates are a package operation, handled by the same command that patches the rest of the system.
dnf check-update
sudo dnf update code
Microsoft documents that the yum repository can lag a new release by up to three hours because of its signing pipeline, so the in-editor update notification occasionally appears before dnf sees the build. Wait for the repository to catch up rather than mixing install methods. What each monthly release changes is documented in the release notes.
Install From the RPM File Directly
Air-gapped machines, or a policy that pins software versions, call for the standalone RPM instead of the repository. The stable permalink always resolves to the newest build:
curl -L -o code-stable.rpm "https://update.code.visualstudio.com/latest/linux-rpm-x64/stable"
Install it with dnf rather than rpm so dependencies resolve from the distribution repositories:
sudo dnf install ./code-stable.rpm
Installed this way, nothing updates automatically. You repeat the download for every new release, which is exactly the point on a pinned system and a chore everywhere else. For connected machines the repository is the right default.
Uninstall VS Code
Removal is one package:
sudo dnf remove code
On our test system that freed a full gigabyte once unused dependencies went with it. Drop the repository definition too if you are done with Microsoft packages:
sudo rm /etc/yum.repos.d/vscode.repo
Settings and extensions survive in your home directory, so a later reinstall picks them straight back up. For a full wipe, remove those and the cache as well:
rm -rf ~/.config/Code ~/.vscode ~/.cache/Code
That covers the full lifecycle on the Red Hat family. The flow on Debian-based systems is close but the packaging differs; see installing VS Code on Ubuntu. And when the editor needs to follow you into a browser, we cover running VS Code in the browser behind Let’s Encrypt and deploying code-server on Kubernetes with Helm.
I there, almost done but dead errors!
[linux1@mtm2020 ~]$ sudo dnf install code
Repository code is listed more than once in the configuration
Error:
Problem: cannot install the best candidate for the job
– package code-1.59.0-1628120127.el8.x86_64 does not have a compatible architecture
– nothing provides libm.so.6(GLIBC_2.2.5)(64bit) needed by code-1.59.0-1628120127.el8.x86_64
– nothing provides libpthread.so.0(GLIBC_2.2.5)(64bit) needed by code-1.59.0-1628120127.el8.x86_64
Tried –nobest and –skip-broken also but no chance!
Any idea?
Thank you!
Hi,
What’s the release version of your OS?
Did you try yum update before code installation and see how it behaves?