Visual Studio Code is a free source-code editor made by Microsoft for Windows, 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 guide, you will learn how to install Visual Code Editor on openSUSE Leap 15.
- Recommended OS: openSUSE Leap – 15.x
- User account: A user account with sudo or root access.
Update Operating System
Update your openSUSE operating system to make sure all existing packages are up to date:
sudo zypper refresh
The tutorial will be using the sudo command and assuming you have sudo status.
To verify sudo status on your account:
Example output showing sudo status:
[joshua@opensuse ~]$ sudo whoami root
To set up an existing or new sudo account, visit our tutorial on adding a User to Sudoers on openSUSE.
To use the root account, use the following command with the root password to log in.
Create & Import Visual Studio Repository
By default, Visual Studio does not come included in the openSUSE repositories. However, you can quickly import the Visual Studio official repository on your system by doing the following.
First, import the VS Code repository using the following command.
sudo zypper ar https://packages.microsoft.com/yumrepos/vscode vscode
Next, import the GPG to verify the authenticity of the package.
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
Install Visual Studio Code
With the source repository sorted, you must refresh your zypper 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 zypper refresh
During the refresh, you will know if the repositories were successfully imported with the following output:
Retrieving repository 'vscode' metadata ..................................[done] Building repository 'vscode' cache .......................................[done]
Now install Visual Studio with the following command:
sudo zypper install code
Type “Y,” then press the “ENTER KEY” to proceed and complete the installation.
To confirm the installation, you can use the verify version command as follows:
1.61.2 6cba118ac49a1b88332f312a8f67186f7f3c1643 x64
How to Launch Visual Studio Code
With the installation complete, you can run Visual Studio in a few different ways. First, while you are in your terminal, you can use the following command:
Alternatively, run the code command in the background to free up the terminal:
However, this isn’t practical, and you would use the following path on your desktop to open with the path: Activities > Show Applications > Visual Studio Code. If you cannot find it, use the search function in the Show Applications menu if you have many applications installed.
The first time you open Visual Studio, you will see the following window:
Congratulations, you have installed Visual Studio Code on openSUSE Leap 15.
How to Update Visual Studio Code
To update VS Code, run the zypper update command in your terminal as you would check your entire system for any updates.
sudo zypper refresh
How to Remove (Uninstall) Visual Studio Code
To remove the Visual Studio software from your system, run the following command in your terminal:
sudo zypper remove code
Type Y, then press the ENTER KEY to proceed with the removal of Visual Studio.
Comments and Conclusion
The guide has shown you how to install Microsoft Visual Code for openSUSE Leap and add the repository to update the program without manually re-downloading and installing. Visual Code is one of the most used free IDE editors on the planet. It is also lightweight and an excellent option for your system if you run services and servers instead of using the default Linux text editors such as vim or nano.