This guide will teach you How To Install Visual Studio Code or VS Code on AlmaLinux 9.
Visual Studio Code is a free, lightweight but powerful source code editor that runs on your desktop and on the web and is available for Windows, macOS, Linux, and Raspberry Pi OS.
Steps To Install Visual Studio Code on AlmaLinux 9
To complete this guide, you must log in to your server as a non-root user with sudo privileges. To do this, you can follow our guide on Initial Server Setup with AlmaLinux 9.
Install Visual Studio Code on AlmaLinux 9
First, you need to update your local package index with the following command:
sudo dnf update -y
Then, install the development tools by using the command below:
sudo dnf groupinstall "Development Tools"
Visual studio code packages are not available in the default AlmaLinux repository. So you need to add it to your server.
Import Visual Studio Code GPG key
Here you need to import the GPG key to verify the authenticity of the packages to be installed. To do this, run the command below:
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
Add Visual Studio Code Repository
Now use the following command to import the repository on your server:
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
Output [vscode] name=packages.microsoft.com baseurl=https://packages.microsoft.com/yumrepos/vscode/ enabled=1 gpgcheck=1 repo_gpgcheck=1 gpgkey=https://packages.microsoft.com/keys/microsoft.asc metadata_expire=1h
When you are done, run the system update:
sudo dnf update -y
Install VS Code on AlmaLinux 9
Now you can install Visual studio code on AlmaLinux 9 by using the following command:
sudo dnf install code -y
How To Launch VS Code
At this point, you can use different ways to open your VS code. You can easily launch your software, by using the following command:
Or, you can run the
code & command, which you can continue to use the terminal during the application session:
Also, you can open VSCode from your desktop. To do this, follow the following path:
Applications -> Programming -> Visual Studio Code
When you start VS Code for the first time, a window like the following will be displayed:
You can now begin installing extensions and configuring VS Code according to your preferences.
For more information, you can visit Visual Studio Code Documentation.
Update Visual Studio Code on AlmaLinux 9
When a new version of Visual Studio Code is released you can update the package through your desktop standard Software Update tool or by running the following commands:
# sudo apt update # sudo apt upgrade
Remove VS Code
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*
At this point, you have learned to Install Visual Studio Code on AlmaLinux 9.
Hope you enjoy it.
You may be like these articles:
How To Install WineHQ on AlmaLinux 9
Install Varnish Cache with Nginx on AlmaLinux 9