How to Install Visual Studio Code on AlmaLinux 8

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 8 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.

Update AlmaLinux

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 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.

code

Alternatively, run the code & command, which you can continue to use the terminal during the applications session.

code &

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

Example:

How to Install Visual Studio Code on AlmaLinux 8

The first time you open Visual Studio Code IDE, you will see a prompt asking you to select the color them, do this by clicking Mark as done in the window’s bottom left-hand corner, and that is it you are good to go.

How to Install Visual Studio Code on AlmaLinux 8

Congratulations, you have installed Visual Studio Code on AlmaLinux.

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

In the tutorial, you learned how to import the Microsoft repository to install the latest stable version of Visual Studio Code (VSCode) on AlmaLinux 8.

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!



Follow LinuxCapable.com!

Like to get automatic updates? Follow us on one of our social media accounts!