How to Install Visual Studio Code on Fedora 35

0

Visual Studio Code is a cross-platform source code editor developed by Microsoft. It has built-in debugging support, syntax highlighting, code completion, embedded Git control, code refactoring, and snippets.

Visual Studio Marketplace offers lots of plugins and extensions to extend the functionality of VS code.

Here, we will see how to install Visual Studio Code on Fedora 35.

Add VS Code Repository

Visual Studio Code is available from the Microsoft repository for the Fedora operating system. So, you will need to set up the Microsoft repository on your system to get the VS Code package.

First, switch to the root user.

sudo su -

Then, download and import the Microsoft signing GPG key using the following command in the terminal.

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

Finally, add the Microsoft Visual Studio Code repository to your system.

cat << EOF > /etc/yum.repos.d/vscode.repo
[code]
name=Visual Studio Code
baseurl=https://packages.microsoft.com/yumrepos/vscode
enabled=1
gpgcheck=1
gpgkey=https://packages.microsoft.com/keys/microsoft.asc
EOF

Install Visual Studio Code on Fedora 35

Once you have added the repository to the system, use the dnf command to install Visual Studio Code.

dnf install -y code

Output:

Fedora 35 - x86_64                                                             2.3 MB/s |  61 MB     00:27
Fedora 35 openh264 (From Cisco) - x86_64                                       2.9 kB/s | 2.5 kB     00:00
Fedora Modular 35 - x86_64                                                     462 kB/s | 2.6 MB     00:05
Fedora 35 - x86_64 - Updates                                                   1.9 MB/s | 9.8 MB     00:05
Fedora Modular 35 - x86_64 - Updates                                           1.3 MB/s | 3.3 MB     00:02
Visual Studio Code                                                              11 MB/s |  19 MB     00:01
Dependencies resolved.
===============================================================================================================
 Package                      Architecture       Version                              Repository          Size
===============================================================================================================
Installing:
 code                         x86_64             1.62.0-1635954170.el7                code               103 M
Installing dependencies:
 gtk2                         x86_64             2.24.33-5.fc35                       fedora             3.5 M
 ibus-gtk2                    x86_64             1.5.25-4.fc35                        fedora              27 k
Installing weak dependencies:
 libcanberra-gtk2             x86_64             0.30-26.fc35                         fedora              25 k

Transaction Summary
===============================================================================================================
Install  4 Packages

Total download size: 106 M
Installed size: 306 M
Downloading Packages:
(1/4): libcanberra-gtk2-0.30-26.fc35.x86_64.rpm                                 48 kB/s |  25 kB     00:00
(2/4): ibus-gtk2-1.5.25-4.fc35.x86_64.rpm                                       50 kB/s |  27 kB     00:00
(3/4): code-1.62.0-1635954170.el7.x86_64.rpm                                   8.6 MB/s | 103 MB     00:11
(4/4): gtk2-2.24.33-5.fc35.x86_64.rpm                                          196 kB/s | 3.5 MB     00:18
---------------------------------------------------------------------------------------------------------------
Total                                                                          5.9 MB/s | 106 MB     00:18
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                       1/1
  Installing       : libcanberra-gtk2-0.30-26.fc35.x86_64                                                  1/4
  Installing       : gtk2-2.24.33-5.fc35.x86_64                                                            2/4
  Installing       : ibus-gtk2-1.5.25-4.fc35.x86_64                                                        3/4
  Installing       : code-1.62.0-1635954170.el7.x86_64                                                     4/4
  Running scriptlet: code-1.62.0-1635954170.el7.x86_64                                                     4/4
  Verifying        : gtk2-2.24.33-5.fc35.x86_64                                                            1/4
  Verifying        : ibus-gtk2-1.5.25-4.fc35.x86_64                                                        2/4
  Verifying        : libcanberra-gtk2-0.30-26.fc35.x86_64                                                  3/4
  Verifying        : code-1.62.0-1635954170.el7.x86_64                                                     4/4

Installed:
  code-1.62.0-1635954170.el7.x86_64         gtk2-2.24.33-5.fc35.x86_64      ibus-gtk2-1.5.25-4.fc35.x86_64
  libcanberra-gtk2-0.30-26.fc35.x86_64

Complete!

Launch Visual Studio Code

Once the VS Code is installed on your system, you can launch it by going to Activities >> search for Visual Studio Code or running the command code in the terminal.

Visual Studio Code running on Fedora 35:

Visual Studio Code running on Fedora 35
Visual Studio Code running on Fedora 35

Update Visual Studio Code

Microsoft releases updates for Visual Studio Code every month. So, to update the Visual Studio Code to the latest version, use the below command.

dnf update code

Conclusion

I hope you have successfully installed Visual Studio Code on your Fedora 35. Next, you can head to install extensions and configure VS Code according to your preferences.

You might also like