Visual Studio Code is a free source-code editor made by Microsoft for Windows and Linux macOS. Visual Studio Code features include support for debugging, embedded Git control, intelligent code completion, snippets, and code refactoring. Microsoft Visual Studio Code also has an extensive extension library that can further support dedicated software development and coding to enrich and help develop and use the software.
In the following tutorial, you will learn how to install Visual Code Editor (VSCode) on AlmaLinux 9 using the command line terminal and the official repository from Microsoft to ensure you always have the latest updated version of this famous free IDE. The tutorial will also show some tips on updating the software using the command line terminal and how to remove the IDE editor.
Table of Contents
The first step is to make sure your system is up-to-date to avoid issues during the installation and for good practice. This is done by opening your terminal and using the following command.
sudo dnf upgrade --refresh
Install Visual Studio Code (VSCode)
Visual Studio is not included in the standard AlmaLinux 9 appstream by default. However, you can quickly create and import the Visual Studio official repository on your system by doing the following.
First, import the GPG key to verify the authenticity of the packages to be installed.
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
Next, import the repository using the following command.
printf "[vscode]\nname=packages.microsoft.com\nbaseurl=https://packages.microsoft.com/yumrepos/vscode/\nenabled=1\ngpgcheck=1\nrepo_gpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc\nmetadata_expire=1h" | sudo tee -a /etc/yum.repos.d/vscode.repo
With the source repository sorted, you must refresh your dnf package manager sources list to reflect the new addition before the Visual Studio installation. To do this, run the following command in your terminal:
sudo dnf install code -y
How to Launch Visual Studio Code (VSCode)
Now that you have completed the installation, you can open the software in a few ways.
Using the command line terminal, you can open the software quickly by using the following command.
The best way to use VSCode for desktop users that prefer not to use the command line terminal is to open the GUI of the application by following the path.
Activities > Show Applications > Visual Studio Code
Once open, you can begin to use the IDE editor. For users that may want a more private version check out “How to Install VSCodium on AlmaLinux 9,” which, for the most part, works excellent beside a few sacrifices like access to the Microsoft store.
Congratulations, you have installed Visual Studio Code.
How to Update Visual Studio Code (VSCode)
To check for updates using the command line, use the following command to allow a blanket check for any updates across all DNF packages.
sudo dnf update --refresh
How to Remove (Uninstall) Visual Studio Code (VSCode)
When you no longer want VSCode installed on your system, use the following command to remove it.
sudo dnf autoremove code -y
Next, remove the repository using the following command if you plan never to re-install the IDE again.
sudo rm /etc/yum.repos.d/vscode*
Comments and Conclusion
If you are looking for an excellent, lightweight IDE editor that can handle a variety of programming languages, Microsoft Visual Studio Code is the best option on the market. With its vast library of extensions and themes and its intuitive user interface, VS Code will make your coding experience more enjoyable. Have you tried using VS Code for your development projects? Let us know in the comments below!