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.
Here at LinuxAPT, as part of our Server Management Services, we regularly help our Customers to perform Visual Studio related queries on Linux Servers.
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.
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.
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
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.
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.
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.
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
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
This article covers how to install the VS code package on CentOS 8 using the command line application. Visual Studio Code is a free and open-source, cross-platform IDE or code editor that enables developers to develop applications and write code using a myriad of programming languages such as C, C++, Python, Go and Java to mention a few.
To Install Visual Studio Code on Debian, Ubuntu and Linux Mint:
1. Update your system by running the command.
$ sudo apt update
2. Once updated, proceed and install dependencies required by executing.
$ sudo apt install software-properties-common apt-transport-https
3. Next, using the wget command, download the repository and import Microsoft’s GPG key as shown:
$ wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg
$ sudo install -o root -g root -m 644 packages.microsoft.gpg /etc/apt/trusted.gpg.d/
$ sudo sh -c 'echo "deb [arch=amd64 signed-by=/etc/apt/trusted.gpg.d/packages.microsoft.gpg] https://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list'
4. Once you’ve enabled the repository, update the system and install Visual Studio Code by running the command:
$ sudo apt update
$ sudo apt install code