Install Visual Studio Code on AlmaLinux 9 | Free Code Editor
This guide on the Orcacore website will teach you How To Install Visual Studio 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.
It comes with built-in support for JavaScript, TypeScript, and Node.js and has a rich ecosystem of extensions for other programming languages (such as C++, C#, Java, Python, PHP, and Go), runtimes (such as .NET and Unity), environments (such as Docker and Kubernetes), and clouds (such as Amazon Web Services, Microsoft Azure, and Google Cloud Platform).
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.
1. Install VS 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.comnbaseurl=https://packages.microsoft.com/yumrepos/vscode/nenabled=1ngpgcheck=1nrepo_gpgcheck=1ngpgkey=https://packages.microsoft.com/keys/microsoft.ascnmetadata_expire=1h" | sudo tee -a /etc/yum.repos.d/vscode.repo

When you are done, run the system update:
sudo dnf update -y
Install VS Code
Now you can install Visual Studio Code on AlmaLinux 9 by using the following command:
sudo dnf install code -y
2. 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:
code
Or, you can run the code &
command, which you can continue to use the terminal during the application session:
code &
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.
3. 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 dnf update
# sudo dnf upgrade
4. Remove VS Code from AlmaLinux 9
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*
Conclusion
At this point, you have learned to Install Visual Studio Code on AlmaLinux 9. VS Code on AlmaLinux 9 is used as a lightweight, powerful code editor for software development, offering features like debugging, version control, and extensions for various programming languages.
Hope you enjoy it. You may also like these articles:
How To Install WineHQ on AlmaLinux 9
Install Varnish Cache with Nginx on AlmaLinux 9
How To Install Anaconda on AlmaLinux 9
Alternative Installation Methods for Visual Studio Code on AlmaLinux 9
While the provided method using the official Microsoft repository is the recommended and generally easiest approach, there are alternative ways to install Visual Studio Code on AlmaLinux 9. Here are two different approaches you can use:
1. Using Flatpak
Flatpak is a universal package management system that allows you to install applications across different Linux distributions. It provides a sandboxed environment for applications, enhancing security and isolating them from the core system.
Steps to install Visual Studio Code using Flatpak:
-
Install Flatpak: If Flatpak is not already installed on your AlmaLinux 9 system, you can install it using the following command:
sudo dnf install flatpak
-
Add the Flathub repository: Flathub is the primary repository for Flatpak applications. Add it to your system:
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
-
Install Visual Studio Code: Now, install Visual Studio Code using Flatpak:
flatpak install flathub com.visualstudio.code
This command will download and install Visual Studio Code from the Flathub repository.
-
Run Visual Studio Code: After the installation is complete, you can run Visual Studio Code using the following command:
flatpak run com.visualstudio.code
Alternatively, you should find it in your application menu.
Advantages of using Flatpak:
- Sandboxing: Flatpak provides a sandboxed environment, which enhances security.
- Latest Versions: Flatpak often provides newer versions of applications compared to the system repositories.
- Dependency Management: Flatpak manages dependencies automatically, reducing conflicts.
Disadvantages of using Flatpak:
- Larger Size: Flatpak applications can be larger in size because they include their dependencies.
- Performance Overhead: Sandboxing can sometimes introduce a small performance overhead.
2. Manual Installation (Downloading the .rpm Package)
Another alternative is to download the .rpm
package directly from the Visual Studio Code website and install it manually using the rpm
command.
Steps to install Visual Studio Code Manually:
-
Download the .rpm package: Go to the official Visual Studio Code download page (https://code.visualstudio.com/download) and download the
.rpm
package for Linux. Choose the RPM package. -
Install the package: Open a terminal and navigate to the directory where you downloaded the
.rpm
package. Then, use the following command to install it:sudo rpm -ivh <vscode_package_name>.rpm
Replace
<vscode_package_name>.rpm
with the actual name of the downloaded file. For example:sudo rpm -ivh code-1.85.1-1699955878.el9.x86_64.rpm
If you encounter dependency issues, you can try resolving them using
dnf
:sudo dnf install -y --allowerasing <vscode_package_name>.rpm
-
Run Visual Studio Code: After the installation is complete, you can run Visual Studio Code by typing
code
in the terminal or finding it in your application menu.
Advantages of Manual Installation:
- Direct Control: You have direct control over the installation process.
- Offline Installation: You can install Visual Studio Code without an active internet connection after downloading the package.
Disadvantages of Manual Installation:
- Manual Updates: You need to manually download and install new versions when they are released.
- Dependency Management: You are responsible for resolving any dependency issues that may arise.
These alternative methods offer flexibility in how you Install Visual Studio Code on AlmaLinux 9, depending on your specific needs and preferences. The Flatpak method provides a sandboxed environment and easy updates, while the manual installation method gives you more control over the process. Choose the method that best suits your requirements.