How to Install VS Code on Fedora Linux: A Step-by-Step Guide

This guide walks you through installing Visual Studio Code on Fedora Linux, following the recommended way.

Visual Studio Code (often abbreviated as VS Code) is a free, cross-platform, and open-source code editor developed by Microsoft that is available for Windows, Linux, and macOS.

The combination of a lightweight editor and powerful functionality has contributed to VS Code’s rise as one of the most popular integrated development environment (IDE) tools in recent years.

Its key features include syntax highlighting, built-in debugging support, embedded Git control, code completion, an integrated terminal, snippets, and code refactoring.

This guide will walk you through installing Visual Studio Code on your Fedora system using the officially approved method.

Install Visual Studio Code on Fedora Linux

The methods below show how to install Visual Studio Code on Fedora from the official Microsoft repository.

1. Import Microsoft’s GPG Key

To ensure that the packages we receive to install the Visual Studio Code are genuine, we should download and import the Microsoft signed GPG keys on our Fedora system.

To do so, type the following commands:

sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc

2. Add Microsoft’s Visual Studio Code Repository

After importing the GPG keys, we’ll add the official Microsoft Visual Studio Code repository to our Fedora system. This implies that the update package will be made available with the rest of our system’s regular updates if a new version is released.

To accomplish it, type the command shown below.

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'

3. Run System Update

Before we proceed with VS Code installation on our Fedora Linux system, we should update the list of available packages. So, run the below DNF command to update the repositories index.

sudo dnf update
Updating package index

As you can see, our new Microsoft Visual Studio Code repository is now available and ready to be used.

4. Install VS Code on Fedora Linux

Everything is already prepared for the actual installation. Now, to install VS Code on Fedora, run the following commands:

sudo dnf install code
Install VS Code on Fedora Linux

4. Run Visual Studio Code on Fedora

After installation, you can start using VS Code by launching it from the desktop application menu. Search for “code,” and when its icon appears, click to run the same.

Run Visual Studio Code on Fedora

When you start VS Code for the first time, a window like the following should appear:

VS Code launched on Fedora Linux

Conclusion

This guide showed how to install Visual Studio Code on Fedora Linux. If you have any questions, please leave them in the comments section below.

To learn more about Visual Studio Code, visit its official documentation page.

Bobby Borisov

Bobby Borisov

Bobby, an editor-in-chief at Linuxiac, is a Linux professional with over 20 years of experience. With a strong focus on Linux and open-source software, he has worked as a Senior Linux System Administrator, Software Developer, and DevOps Engineer for small and large multinational companies.

Think You're an Ubuntu Expert? Let's Find Out!

Put your knowledge to the test in our lightning-fast Ubuntu quiz!
Ten questions to challenge yourself to see if you're a Linux legend or just a penguin in the making.

1 / 10

Ubuntu is an ancient African word that means:

2 / 10

Who is the Ubuntu's founder?

3 / 10

What year was the first official Ubuntu release?

4 / 10

What does the Ubuntu logo symbolize?

5 / 10

What package format does Ubuntu use for installing software?

6 / 10

When are Ubuntu's LTS versions released?

7 / 10

What is Unity?

8 / 10

What are Ubuntu versions named after?

9 / 10

What's Ubuntu Core?

10 / 10

Which Ubuntu version is Snap introduced?

The average score is 68%

2 Comments

  1. I am brand new to fedora and have no idea how to use the terminal. I tried copy/pasting your code and got ‘sudo command not found’
    What am I doing wrong?

    • Hi Shelley, and welcome to the wonderful world of Linux!

      The sudo command allows you to temporarily elevate your current user account to have root privileges. In Linux, you must have so-called superuser permissions to install the software. In this case, root, or one with privileges to execute commands with root ones.

      So, if you don’t have the sudo command installed on your Fedora system, you can quickly get it by just running “dnf install sudo” as a root user in the terminal app (Terminal).

      I also encourage you to look at our article “DNF Command-Line Package Manager in Linux: A Complete Guide” to get a good idea of how to manage software in Fedora Linux.

      Best,
      Bobby

Leave a Reply

Your email address will not be published. Required fields are marked *