Visual Studio Code is a cross-platform and open-source code editor that is developed by Microsoft. It offers built-in various features in which debugging support, syntax highlighting, embedded Git control, integrated terminal, snippets, code completion, and refactoring are included.
In this context, we shall look into how to install the Visual Studio Code package on CentOS 8 distribution by using the Terminal application.
So, just open the terminal from the left sidebar of your desktop and start the implementations.
How to install Visual studio code on CentOS 8 ?
To begin, ensure that you are logged in as root or have the privilege to run sudo commands on your system.
To install Visual Studio Code on the CentOS 8 system, the recommended method is to enable the Visual Studio code repository on your system and then, install the required Visual Studio Code package using the Terminal application.
To install the Visual Studio Code using the recommended way, follow the following steps on your CentOS 8 system.
1. Import Microsoft GPG key
The first step is to import the rpm package Microsoft GPG on your system by running the below-mentioned command:
$ sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
2. Enable Visual Studio Code Repository
To enable the Visual Studio Code repository on CentOS 8, open a text editor and create a new repository file as follows:
$ sudo nano /etc/yum.repos.d/vscode.repo
Now, paste the following configurations in the VS code file to enable or activate the Visual Studio Code repository on your system:
name=Visual Studio Code
Save this file use the shortcut keys 'Ctrl+O' and then press 'Ctrl+X' to exit from the nano editor.
Again, the terminal environment shows on your system after using the 'Ctrl+X' shortcut key.
3. Install VS Code Package on CentOS 8
Now, the VS Code repository is enabled on your system. Use the following command to install the latest Visual Studio Code package on your CentOS 8 system:
$ sudo dnf install code
Now, you can start and use it on your system.
4. Launch VS Code Environment on CentOS 8
i. Once the Visual Studio Code installation is completed on your CentOS 8 system, you can easily start the VS code environment through the terminal by typing the 'code' or launch the Visual Studio Code application through the application search bar.
ii. Click on the displayed icon to open the start window on your system CentOS 8.
iii. When the Visual Studio Code environment first time starts on your system, the Welcome interface shows on your system.
Now, you can install the required extensions and set the VS code interface based on your needs.
How to Update Visual Studio Code Package on CentOS 8 ?
When the new version is released of VS Code package, you can update the install Visual Studio Code package using the Software update tool and type the following command on the terminal to update this package:
$ sudo dnf update
How to Uninstall Visual Studio Code from CentOS 8 ?
To uninstall or remove the VS code from your CentOS 8 system, use the below-mentioned command. This command removes the VS code package with all its dependencies:
$ sudo dnf remove code