• Home
  • Ubuntu 18.04
    • Whats New?
    • Upgrade Ubuntu
    • Install Java
    • Install Node.js
    • Install Docker
    • Install Git
    • Install LAMP Stack
  • Tutorials
    • AWS
    • Shell Scripting
    • Docker
    • Git
    • MongoDB
  • Funny Tools
  • FeedBack
  • Submit Article
  • About Us
TecAdmin
Menu
  • Home
  • Ubuntu 18.04
    • Whats New?
    • Upgrade Ubuntu
    • Install Java
    • Install Node.js
    • Install Docker
    • Install Git
    • Install LAMP Stack
  • Tutorials
    • AWS
    • Shell Scripting
    • Docker
    • Git
    • MongoDB
  • Funny Tools
  • FeedBack
  • Submit Article
  • About Us

How to Install Visual Studio Code Editor in Fedora and CentOS

Written by Rahul, Updated on October 17, 2019

Visual Studio Code (not Visual Studio IDE) is a lightweight source code editor for JavaScript, TypeScript and Node.js Applications. It also has extensions for multiple other programming languages like C++, C#, Python, PHP, Go, etc. This tutorial will help you to install Visual Studio Code on CentOS, RHEL, Fedora and its derivatives systems. Remember that Visual Studio Code is Different than Visual Studio IDE

  • How to Install Visual Studio Code Editor in Ubuntu & Debian
  • How to Install Visual Studio Code Editor in SEL & openSUSE
Note: Visual Studio Code is Different that Visual Studio IDE

Step 1 – Enable Yum Repository

Visual Studio code provides an official yum repository for the installation of package on Yum supported system. The same repository can be used for Fedora systems to use with dnf. Let’s create a new file /etc/yum.repos.d/vscode.repo and edit in your favorite text editor.

vim /etc/yum.repos.d/vscode.repo

Add the below content:

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

Step 2 – Install Visual Studio Code

The Yum will manage the gpg key for you, But you can also Import the package signing GPG key on your system using the following command.

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

After importing GPG key, Let’s use commands to install Visual Studio Code on your RHEL based system.

## CentOS and RHEL system
sudo yum check-update
sudo yum install code

## Fedora systems:
sudo dnf install code

Step 3 – Launch Visual Studio Code

The Visual Studio Code has been installed on your system. You can now launch the Visual Studio Code editor on your system using the desktop menu. After that create a new file or open files and directories using File menu.

install visual studio code editor

Step 4 – Add Required Extensions

There are a large number of extensions available for Visual Studio Code like C#, Python, JavaScript, Google Chrome, etc. Install the required extensions to enhance your working experience with Visual Studio Code.

install visual studio code ediro

Share it!
Share on Facebook
Share on Twitter
Share on LinkedIn
Share on Reddit
Share on Tumblr
Share on Whatsapp
Rahul
Rahul
Connect on Facebook Connect on Twitter

I, Rahul Kumar am the founder and chief editor of TecAdmin.net. I am a Red Hat Certified Engineer (RHCE) and working as an IT professional since 2009..

8 Comments

  1. Avatar Abid Rather Reply
    January 17, 2021 at 9:15 am

    does it support on Fedora 30

  2. Avatar manas Reply
    September 21, 2019 at 4:58 am

    hi rahul, after type command /code . –> visual studio is not opening. in command line how can i open visual studio generally i am not using windows am using server version of centos.

    error: It is recommended to start vscode as a normal user. To run as root, you must specify an alternate user data directory with the –user-data-dir argument.
    then
    sudo code –user-data-dir /home/fregie/.code-root-user-data

    nothing is working…

  3. Avatar David Carlin Reply
    September 4, 2019 at 6:15 am

    vim command needs to be run with sudo if you are not running in root, otherwise there is a permissions issue with creating a directory in /etc.

  4. Avatar Doan Reply
    June 1, 2018 at 3:03 am

    I already completed above steps, but when I run command “code” to launch, it got msg” -bash: /usr/local/bin/code: No such file or directory”

  5. Avatar Mike Rooney Reply
    November 16, 2017 at 3:33 am

    Thanks Rahul – this worked perfectly for me on Centos7/x64.

  6. Avatar Rodolfo Reply
    November 12, 2017 at 12:53 am

    Genial! Gracias

  7. Avatar Rick Munoz Reply
    June 1, 2017 at 9:29 pm

    Thanks for the great post. Yum check-update did seem to fetch the vscode files. Unfortunately the sudo yum install code returns:

    No package code available
    Error: unable to find a match

    When I run yum list | grep vscode I get this:

    code.x86_64 1.12.2-1494422362.el7 vscode

    So I’m not sure what I’m doing wrong. (Yes, I’m a Linux newbie). Thanks.

    (running F25)

    • Avatar Sandipan Majhi Reply
      April 7, 2018 at 3:05 pm

      Doesn’t F25 have dnf. I am also a newbie but I don’t know if yum works in Fedora.

Leave a Reply Cancel reply

Popular Posts

  • How To Install Python 3.9 on Ubuntu 20.04 5
  • How to Install Python 3.9 on CentOS/RHEL 7 & Fedora 32/31 0
  • How To Install VNC Server on Ubuntu 20.04 1
  • How To Install NVM on macOS with Homebrew 0
  • How to Install .NET Core on Debian 10 0
© 2013-2020 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy