You need VS Code, but Fedora says the package does not exist
You install a fresh Fedora Workstation, open the application grid, and realize Visual Studio Code is missing. You run sudo dnf install code and the terminal replies with a package not found error. You need a reliable editor that integrates with your system updates, not a standalone binary that drifts from your security patches. The solution requires adding Microsoft's official repository and teaching the package manager to trust it.
What is actually happening
Fedora's default repositories follow strict open-source licensing guidelines. Microsoft distributes VS Code as a proprietary RPM package signed with a separate GPG key. The dnf package manager refuses to install software from unverified sources by default. You are not fighting a broken system. You are working with a security boundary that requires explicit configuration.
Think of the package manager like a library catalog. Fedora's catalog only lists books from approved publishers. Microsoft runs a separate publishing house. You need to add their catalog to your local index and verify their author signatures before the library will accept their books. The RPM transaction model ensures that every package download, dependency resolution, and file placement happens atomically. If any step fails, the system rolls back to its previous state.
Add the repository and install the editor
Fedora stores third-party repository definitions in /etc/yum.repos.d/. Files in this directory are user-modified and survive system upgrades. Never edit files in /usr/lib/ or /usr/share/ for this purpose. Those directories ship with packages and get overwritten on updates.
Here is how to import the Microsoft signing key and create the repository definition file.
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
# Imports the GPG public key into the RPM database so dnf can verify package signatures
sudo sh -c '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" > /etc/yum.repos.d/vscode.repo'
# Writes the repository configuration to the correct system directory with root privileges
sudo dnf check-update
# Forces dnf to refresh its metadata cache before attempting installation
sudo dnf install code -y
# Downloads and installs the VS Code RPM along with its dependencies
The repository file uses standard yum/dnf INI syntax. The gpgcheck=1 line ensures every package download is cryptographically verified. The enabled=1 line tells the package manager to query this source during normal operations. The baseurl points to Microsoft's official YUM repository, which mirrors the latest stable release.
Run sudo dnf upgrade --refresh weekly to keep VS Code aligned with the rest of your system. This command forces a metadata refresh and applies all pending updates in a single transaction. It is the standard maintenance command for Fedora desktops. Do not confuse it with dnf system-upgrade, which is reserved for crossing major Fedora releases.
Verify the installation
Confirm the package installed correctly and check its version before configuring extensions.
code --version
# Prints the editor version, commit hash, and Electron runtime version
rpm -qi code
# Displays the RPM metadata including install date, architecture, and repository source
The output should show a recent version number and list code as the repository source. If rpm -qi returns package code is not installed, the transaction failed silently or the repository URL changed. Check the network connection and verify the repository file contents. Run cat /etc/yum.repos.d/vscode.repo to confirm the syntax matches the example above.
Configure extensions and settings from the terminal
The GUI extension marketplace works fine, but the command line gives you reproducible, scriptable configuration. This matters when you provision multiple machines or want to version control your development environment.
Here is how to install the core extensions recommended for Fedora development workflows.
code --install-extension ms-python.python
# Adds Python language support, IntelliSense, and debugging capabilities
code --install-extension eamodio.gitlens
# Provides inline blame annotations and enhanced Git history navigation
code --install-extension timonwong.shellcheck
# Runs static analysis on bash scripts and highlights syntax errors in real time
code --install-extension editorconfig.editorconfig
# Enforces consistent coding styles across projects using .editorconfig files
Extension installation happens asynchronously. The terminal returns immediately after queuing the download. Wait ten seconds before opening the editor to ensure the extensions finish unpacking. The code CLI tool communicates with the background extension host process, which handles dependency resolution and file placement in ~/.vscode/extensions/.
Settings live in a JSON file at ~/.config/Code/User/settings.json. JSON does not support inline comments, so each configuration key requires explicit documentation in your workflow notes. Open the settings file with your preferred editor and apply these baseline tweaks for a Fedora-native experience.
{
"editor.fontFamily": "'Red Hat Mono', 'Cascadia Code', monospace",
"editor.fontSize": 14,
"files.autoSave": "onFocusChange",
"terminal.integrated.defaultProfile.linux": "bash",
"editor.formatOnSave": true
}
The files.autoSave setting prevents data loss when you switch windows or run long compilation tasks. The terminal.integrated.defaultProfile.linux key ensures the integrated terminal launches bash instead of falling back to a generic shell. Red Hat Mono ships with Fedora Workstation by default, so the font renders correctly without additional package installations. The formatOnSave flag triggers language server formatters automatically, keeping your codebase consistent without manual keybindings.
Handle Wayland rendering and desktop file overrides
Fedora's default GNOME session runs on Wayland. VS Code uses Electron, which historically defaulted to X11 compatibility mode. This mismatch causes blurry fonts, misaligned cursors, and input lag. You need to force the Ozone platform to use Wayland directly.
Here is how to launch the editor with native Wayland support for testing.
code --enable-features=UseOzonePlatform --ozone-platform=wayland
# Overrides the default X11 fallback and forces Electron to use the Wayland compositor
If the rendering looks sharp and input feels responsive, make the change permanent. Do not edit /usr/share/applications/code.desktop. That file belongs to the RPM package and gets overwritten on every update. Create a local override instead.
mkdir -p ~/.local/share/applications
cp /usr/share/applications/code.desktop ~/.local/share/applications/
sed -i 's/^Exec=code/Exec=code --enable-features=UseOzonePlatform --ozone-platform=wayland/' ~/.local/share/applications/code.desktop
# Copies the desktop entry to the user directory and appends the Wayland flags to the Exec line
The local override takes precedence over the system-wide file. Reboot or log out and back in to ensure the desktop environment reloads the application registry. The XDG base directory specification guarantees that ~/.local/share/applications/ is scanned before /usr/share/applications/.
Common pitfalls and error patterns
The installation process usually succeeds on the first try. When it fails, the error message points directly to the cause.
If dnf install code prints the following, your system clock is likely out of sync or the Microsoft key expired.
Error: GPG check FAILED
Failing package is: code-1.85.1-1703331895.el8.x86_64
Run timedatectl status to verify NTP synchronization. If the clock is correct, re-import the key with sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc. The RPM database caches keys in /var/lib/rpm/, and stale entries cause verification failures.
If the editor opens but shows Error: Could not find platform independent libraries, your Python installation is broken or the virtual environment path is misconfigured. VS Code's Python extension relies on a working python3 binary. Run python3 --version to confirm the interpreter exists. Install python3 and python3-pip if the command is missing.
If extensions fail to load and the status bar shows Extension host terminated unexpectedly, clear the editor's cache directory. Run rm -rf ~/.config/Code/CachedData and restart the application. The editor rebuilds the cache automatically on launch. Corrupted cache files often result from interrupted updates or power loss during background tasks.
Check journalctl -xeu code.service if you installed a systemd wrapper for background processes. Most desktop users do not need a service unit. The standard desktop file handles session lifecycle correctly. Read the actual error before guessing.
When to use VS Code versus other editors
Use VS Code when you need a feature-rich editor with a massive extension ecosystem and built-in debugging. Use Neovim when you want terminal-native speed, zero GUI dependencies, and full keyboard-driven workflow. Use Emacs when you prefer a highly customizable Lisp-based environment that doubles as an operating system. Stick to the default GNOME Text Editor when you only need quick notes and want zero configuration overhead.
Trust the package manager. Manual file edits drift, snapshots stay. Run sudo dnf upgrade --refresh before you debug. Half the time the symptom is gone.