FedoraRHEL Based

How To Install Visual Studio Code on Fedora 40

Install Visual Studio Code on Fedora 40

In this tutorial, we will show you how to install Visual Studio Code on Fedora 40. Visual Studio Code, often abbreviated as VS Code, is a powerful and versatile code editor developed by Microsoft. Despite its name, it’s not just limited to Visual Studio or Microsoft technologies. VS Code has gained immense popularity among developers across various platforms, including Linux, Windows, and macOS, due to its rich feature set, extensive customization options, and vibrant ecosystem of extensions.

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo‘ to the commands to get root privileges. I will show you the step-by-step installation of the Visual Studio Code on Fedora 40.

Prerequisites

Before we dive into the installation process, ensure that you have the following prerequisites in place:

  • A server running one of the following operating systems: Fedora 40.
  • It’s recommended that you use a fresh OS install to prevent any potential issues.
  • You will need access to the terminal to execute commands. Fedora provides the Terminal application for this purpose. It can be found in your Applications menu.
  • A stable internet connection to download the necessary packages.
  • A non-root sudo user or access to the root user. We recommend acting as a non-root sudo user, however, as you can harm your system if you’re not careful when acting as the root.

Install Visual Studio Code on Fedora 40

Step 1. Update the System.

To ensure a smooth installation, make sure your system is up to date. Open the terminal and execute the following command:

sudo dnf clean all
sudo dnf update

This command updates all the installed packages to their latest versions, ensuring compatibility with VS Code.

Step 2. Installing Visual Studio Code on Fedora 40.

  • Method 1: Install VS Code via the Official Repository

One of the most convenient ways to install Visual Studio Code on Fedora 40 is through the official repository maintained by Microsoft. This method ensures that you receive the latest updates and security patches directly from the source, keeping your installation up-to-date and secure.

Run the following command to import the GPG key used to sign the VS Code packages:

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

Create a new repository file for VS Code by running:

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'

Refresh the package cache to include the newly added VS Code repository:

sudo dnf check-update

Finally, install VS Code using the dnf package manager:

sudo dnf install code
  • Method 2: Install VS Code via Snap Package

Snap is a universal package management system that allows you to install and run applications in a secure, sandboxed environment. Fedora supports Snap packages out of the box, making it a convenient option for installing Visual Studio Code.

If Snap is not already enabled on your Fedora system, you can enable it by running the following command:

sudo dnf install snapd

Once Snap is enabled, you can install Visual Studio Code with a single command:

sudo snap install --classic code
  • Method 3: Install VS Code via Flatpak

Flatpak is another popular package management system that provides a sandboxed environment for running applications. Like Snap, Flatpak is supported on Fedora, offering an alternative method for installing Visual Studio Code.

If Flatpak is not already enabled on your Fedora system, you can enable it by running the following commands:

sudo dnf install flatpak
sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

Once Flatpak is enabled, you can install Visual Studio Code with the following command:

sudo flatpak install flathub com.visualstudio.code

Check the installed version of VS Code:

flatpak run com.visualstudio.code --version

Alternatively, you can install VS Code via the GNOME Software application by searching for “Visual Studio Code” and clicking the “Install” button.

Install Visual Studio Code on Fedora 40

Congratulations! You have successfully installed Visual Studio Code. Thanks for using this tutorial for installing the Visual Studio Code on Fedora 40. system. For additional help or useful information, we recommend you check the Visual Studio Code website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!

r00t

r00t is a seasoned Linux system administrator with a wealth of experience in the field. Known for his contributions to idroot.us, r00t has authored numerous tutorials and guides, helping users navigate the complexities of Linux systems. His expertise spans across various Linux distributions, including Ubuntu, CentOS, and Debian. r00t's work is characterized by his ability to simplify complex concepts, making Linux more accessible to users of all skill levels. His dedication to the Linux community and his commitment to sharing knowledge makes him a respected figure in the field.
Back to top button