How to Install Visual Studio Code (VS Code) on openSUSE Leap 15

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.


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:

sudo whoami

Example output showing sudo status:

[joshua@opensuse ~]$ sudo whoami

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 vscode

Next, import the GPG to verify the authenticity of the package.

sudo rpm --import

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

Example output:

How to Install Visual Studio Code (VS Code) on openSUSE Leap 15

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:

code --version

Example output:


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:

code &

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.


How to Install Visual Studio Code (VS Code) on openSUSE Leap 15

The first time you open Visual Studio, you will see the following window:

How to Install Visual Studio Code (VS Code) on openSUSE Leap 15

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

Example output:

How to Install Visual Studio Code (VS Code) on openSUSE Leap 15

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.

Not what you were looking for? Try searching for additional tutorials.

Leave a Comment