Javatpoint Logo
Javatpoint Logo

How to install VS Code in Red Hat Linux?

What is Visual Studio Code?

VS Code (Visual Studio Code) has been the most popular code editor among developers in recent times. Microsoft developed it and offers a wide variety of capabilities, which include debugging, syntax highlighting, vehicle code finishing touch, and lots of different advanced functions that have made it a favorite IDE (Integrated Development Environment) among developers. It is widely used on Windows and Linux distributions. In this article, we are providing you with step-by-step instructions on installing VS Code on Red Hat Linux, which consists of everything from basic to advance.

Advantages of Using VS Code

Before going with the installation manner, let's discuss why VS Code has received a higher reputation than different code editors. VS Code emerges as a versatile IDE because of its lightweight, clean-to-use nature and several salient features. It helps more than one programming language and framework. It includes some plugins, which makes it easily accessible to nearly any improvement environment. Whether you are developing websites, mobile application development, or cloud-related services, VS Code handles the whole thing effectively. In addition, the code editor integrates seamlessly with Git, which enables developers to manage version control without leaving the application.

Understanding Red Hat Linux

Red Hat Enterprise Linux (RHEL) is a free and open-source Linux operating system (OS) developed by Red Hat. Formerly, it was known as Red Hat Linux Advanced Server. RHEL furnishes a reliable, consistent foundation across environments. It consists of all the necessary tools to deliver application services and workloads. Like all Linux distributions, RHEL follows an open-source model.

Follow the Prerequisites

Before installing VS Code on Red Hat Linux, you need to follow some prerequisites, which are the following:

  • Installed Red Hat Linux on your System with a 7 or later version. You can check it by opening the terminal and executing the following command:

The above command will show you all the information about your Linx distribution. You can see the Name, Verison, ID, HOME_URL, CODENAME and other details related to the system.

  • You must have access to the sudo to install software on your RHEL system.
  • There should be a strong internet connection to download essential packages and software.
  • You must have access to executive Boons. You can get this by using the sudo command, which temporarily gives the superuser the right to execute the command.
  • Verify sudo Access:
    To check if you have access to sudo, open the terminal and run the following command:

After entering the command, you will be asked for a sudo password. Here, enter the password and hit enter.

1. Add the Microsoft Repository

To install VS Code on Red Hat Linux, you need to add the Microsoft repository to your system. The repository includes the VS Code's latest version and is regularly updated. Add the repository by going through the below-mentioned steps:

  • Open a terminal window and import the Microsoft GPG key:

Command

2. Create a Repository File

As the second step, you need to create a repository file for VS Code.

Command

After executing the above-provided command, a new file will be created in the `/etc/yum.repos.d/` directory.

3. Install VS Code

You can install Visual Studio code in many ways on Linux distros. You can do this by going through official website of VS Code and downloading the .rpm package, and with the help of the command. If you are going with the command line, use commands like dnf or yum to install the package, depending on the version of your Red Hat Linux. If you have RHEL 8 and later, go with dnf and for RHEL 7, use yum.

  • By Going Through the Website
    Go to the main website of Visual Studio code, navigate to the Linux section, and click on .rpm to download the package.
    How to install VS Code in Red Hat Linux?
  • Using Command Line
    You can download the package directly using wget command.

Command

The above command saves Visual Studio Code as vscode.rpm in your current directory.s

Installing the Package

Using the RPM package download, you can get the package using dnf and yum.

  • First, update your package list using the provided command:

Using dnf

To install the package, execute the below command in the terminal:

The above command will download the VS code, including all the necessary dependencies.

Using yum

If you're using RHEL 7, go with the following command:

The installation process will begin, and the necessary files will be downloaded and installed on your system.

4. Run the VS Code

After installing the package, you can start immediately your VS Code. You can launch the application using two methods:

1. Using the Terminal

Open the terminal by searching in the search box and open it as administrator. Now, input the given command to launch VS Code:

2. Using Application Menu

You can easily access the VS Code from the application menu. To do this, click on the Application Menu, search for the VS Code, and click to launch.

How to Create a Desktop Launcher?

If the method given above is not, it seems to be easy to launch. You can create a desktop launcher of VS Code to easily find it and launch it.

  • To create a desktop launcher, you need to create a desktop train that defines how to launch the operation.
  • Create a new train in the ~/.local/share/operations directory. You can use any text editor, such as Vim or Nano. Here is an example using the Nano editor of Linux:
  • Now, add the given piece of code to the train:
  • Now, save the train and exit the nano editor.

After creating the desktop launcher, Visual Studio Code will appear in your operation menu or dashboard. You can launch the Visual Studio Code easily from here.

4. Update VS Code

You should update your Visual Studio Code regularly to get new features, improve performance, and fix bugs in your code editor. You can update it using two ways: first is using a command, and the second one is using VS Code's GUI:

1. Using Terminal (Run the below code)

2. Using GUI (Graphical User Interface)

Launch VS Code, click the Settings icon from the left boottom. Then click on the option Check for Updates. After updating, restart your VS Code to make the changes.

Conclusion

Installing Visual Studio Code on Red Hat Linux is a straightforward process. You can benefit from its powerful and advanced features and extensive plugin ecosystem to enhance your development workflow. Whether you're a fresher or experienced developer, VS Code offers the flexibility and tools you need.


Next Topic#





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA