How to Install Visual Studio Code on Fedora Linux

Visual Studio Code (VS Code) is a popular open-source code editor developed by Microsoft. It provides a highly customizable and user-friendly interface, making it a top choice for many programmers and developers. With its wide range of features and extensions, it is no surprise that it is highly recommended for use on a Fedora system.

Installing VS Code on your Fedora system provides many benefits over competitors, including:

  • Multi-platform support: VS Code is available on Linux, Windows, and macOS, making it a versatile choice for developers across multiple operating systems.
  • Built-in debugging: VS Code has a built-in debugging tool that makes it easier for developers to identify and fix issues within their code.
  • Intelligent Code Completion: The editor uses an intelligent code completion feature that provides suggestions and auto-complete options as you type, making coding faster and more efficient.
  • Extensions Marketplace: The extensions marketplace is an impressive collection of extensions that enables developers to enhance their coding experience with additional features and functionality.
  • Integrated Terminal: VS Code comes with a built-in terminal that enables developers to perform tasks such as running scripts, executing commands, and navigating their codebase without leaving the editor.
  • Git Integration: VS Code has excellent integration with Git, enabling developers to easily manage their code repository and work with other developers on projects.
  • Snippets: The editor has built-in snippets that allow developers to create custom code templates that can be easily inserted into their codebase.
  • Language Support: VS Code has robust language support for a wide range of programming languages, including C++, C#, Python, and JavaScript, among others.

This guide will walk you through the Visual Studio Code installation process on your Fedora desktop. Additionally, it will also cover how to install different versions of Visual Studio Code, including the beta or preview build, using the command line terminal.

Step 1. Update Fedora

The first step is ensuring your system is up-to-date to avoid issues during the installation and for good practice. This is done by opening your terminal and using the following command.

sudo dnf upgrade --refresh

Step 2. Install Visual Studio Code (VSCode)

Visual Studio is not included in the standard Fedora repositories by default. However, you can quickly create and import the Visual Studio official repository on your system by doing the following.

First, import the GPG key to verify the installed packages’ authenticity.

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

Next, import the repository using the following command.

printf "[vscode]\nname=packages.microsoft.com\nbaseurl=https://packages.microsoft.com/yumrepos/vscode/\nenabled=1\ngpgcheck=1\nrepo_gpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc\nmetadata_expire=1h" | sudo tee -a /etc/yum.repos.d/vscode.repo

If the command is copied correctly, you should see the following output in your terminal.

Example only:

[vscode]
name=packages.microsoft.com
baseurl=https://packages.microsoft.com/yumrepos/vscode/
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://packages.microsoft.com/keys/microsoft.asc

Now you can install VSCode. There are three options available, and I would suggest installing the stable build for most users, but you can alternatively install the insider’s build or the exploration build.

Install VSCode stable build (Recommended)

sudo dnf install code -y

Install VSCode insiders build

sudo dnf install code-insiders -y

Install VSCode exploration build

sudo dnf install code-exploration -y

Note the first time installing VSCode, you should see the GPG key is imported.

Example:

Importing GPG key 0xBE1229CF:
 Userid     : "Microsoft (Release signing) <gpgsecurity@microsoft.com>"
 Fingerprint: BC52 8686 B50D 79E3 39D3 721C EB3E 94AD BE12 29CF
 From       : https://packages.microsoft.com/keys/microsoft.asc

Ensure the above is correct.

Step 3. Launch Visual Studio Code (VSCode)

Now that you have completed the installation, you can open the software in a few ways.

Using the command line terminal, you can open the software quickly by using the following command.

code

The best way to use VSCode for desktop users that prefer not to use the command line terminal is to open the GUI of the application by following the path.

Activities > Show Applications > Visual Studio Code

Example:

The first time you open Visual Studio, you will see the following window asking about theme options which you can always go back and customize later.

Example:

Congratulations, you have installed Visual Studio Code on Fedora.

Step 4. Additional Commands & Tips

Update Visual Studio Code (VSCode)

To check for updates using the command line, use the following command to allow a blanket check for any updates across all DNF packages.

sudo dnf update --refresh

Remove (Uninstall) Visual Studio Code (VSCode)

When you no longer want VSCode installed on your system, use the following command that matches your installation version to remove it.

Remove VSCode stable build

sudo dnf remove code

Remove VSCode insider’s build

sudo dnf remove code-insiders

Remove VSCode exploration build

sudo dnf remove code-exploration

Next, remove the repository using the following command if you plan never to re-install the IDE again.

sudo rm /etc/yum.repos.d/vscode.repo

Conclusion

In conclusion, installing Visual Studio Code on your Fedora system is a straightforward process that can provide numerous benefits to developers. With its vast array of features, extensions, and customizability, VS Code has become a top choice for developers looking for an efficient and user-friendly code editor. By following the installation steps outlined in this guide, you can start coding on VS Code in no time and take advantage of all the fantastic tools it has to offer. Whether you are a seasoned developer or just starting, installing Visual Studio Code on your Fedora system is an excellent choice to enhance your coding experience.

FAQs with Visual Studio Code on Fedora

Q: Is Visual Studio Code free to install on Fedora?

A: Yes, Visual Studio Code is a free and open-source code editor that can be easily installed on your Fedora system.

Q: Can I install Visual Studio Code using the command line terminal?

A: Yes, you can install Visual Studio Code using the command line terminal on Fedora by following the steps outlined in this guide.

Q: Will my existing extensions and settings be retained if I update Visual Studio Code?

A: Yes, your existing extensions and settings will be retained when you update Visual Studio Code to a newer version.

Q: Can I use Visual Studio Code for languages other than those supported by default?

A: Yes, Visual Studio Code has an extensive extensions marketplace that enables you to add support for other programming languages that are not supported by default.

Q: How often are updates released for Visual Studio Code?

A: Visual Studio Code receives frequent updates, with new features and bug fixes being released monthly.

Q: Does Visual Studio Code have integrated debugging tools?

A: Yes, Visual Studio Code has built-in debugging tools that allow you to identify and fix issues within your code.

Q: Can I customize the interface of Visual Studio Code to suit my preferences?

A: Yes, Visual Studio Code is highly customizable, and you can customize the interface to suit your preferences using themes and extensions.

Q: Is Visual Studio Code available on other operating systems besides Fedora?

A: Yes, Visual Studio Code is available for Windows, macOS, and Linux distributions, including Fedora.

Q: How can I uninstall Visual Studio Code from my Fedora system?

A: To uninstall Visual Studio Code from your Fedora system, run the command ‘sudo dnf remove code’ in the terminal.

Q: Can I collaborate with other developers using Visual Studio Code?

A: Yes, Visual Studio Code has excellent integration with Git, which enables you to collaborate with other developers on projects.

Q: Will installing Visual Studio Code on my Fedora system affect other applications or system performance?

A: Installing Visual Studio Code should not affect other applications or system performance, as it is designed to be lightweight and highly efficient.

Q: What programming languages does Visual Studio Code support by default?

A: Visual Studio Code has built-in support for a wide range of programming languages, including C++, C#, Python, JavaScript, and more.

Q: Can I run Visual Studio Code in a virtual environment?

A: Yes, you can run Visual Studio Code in a virtual environment, making it a highly versatile and flexible code editor.

Q: How can I install Visual Studio Code extensions on Fedora?

A: You can install Visual Studio Code extensions on Fedora by going to the Extensions panel, searching for the desired extension, and clicking the Install button.

Q: Does Visual Studio Code have a user-friendly interface?

A: Yes, Visual Studio Code has a highly user-friendly interface with a customizable layout that allows you to focus on the tools and features that matter most to you.

Q: Can I use Visual Studio Code for web development?

A: Yes, Visual Studio Code is an excellent choice for web development, supporting popular web technologies such as HTML, CSS, and JavaScript.

Q: Can I use Visual Studio Code for mobile app development?

A: Yes, you can use Visual Studio Code for mobile app development by installing the appropriate extensions and SDKs.

Q: How do I check the version of Visual Studio Code installed on my Fedora system?

A: You can check the version of Visual Studio Code installed on your Fedora system by running the command ‘code –version’ in the terminal.

Q: Is it necessary to restart my Fedora system after installing Visual Studio Code?

A: No, it is not necessary to restart your Fedora system after installing Visual Studio Code. You can start using the editor right away.

Share to...