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.
We will explain in this article 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.
You should be logged in as root or have the privilege to run sudo commands on your system.
Installation of Visual studio code on CentOS 8
For the installation of 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:
Step 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
Step 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:
[code] name=Visual Studio Code baseurl=https://packages.microsoft.com/yumrepos/vscode enabled=1 gpgcheck=1 gpgkey=https://packages.microsoft.com/keys/microsoft.asc
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.
Step 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
That is all details about the VS Code installation on CentOS 8 distribution.
Now, you can start and use it on your system.
Step 4: Launch VS Code Environment on CentOS 8
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 as follows:
Click on the displayed icon to open the start window on your system CentOS 8.
When the Visual Studio Code environment first time starts on your system, the following interface shows on your system:
Now, you can install the required extensions and set the VS code interface based on your needs.
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
Uninstall / Remove 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
We have described in this article how to install the VS code package on CentOS 8 using the command line application. Moreover, we have also explored how you can update this package using just a single command. You do not need to install it again on your system. We have also explained the removal step of VS Code in this article Please explain your problem in the comment box. Thanks!
Karim Buzdar holds a degree in telecommunication engineering and holds several sysadmin certifications including CCNA RS, SCP, and ACE. As an IT engineer and technical author, he writes for various websites.