Install Visual Studio Code on elementary OS 6

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 tutorial, you will learn how to Install Visual Code Editor (VS CODE) elementary OS 6.

Update elementary OS

Firstly, it is advised to update your system to make sure all existing packages are up to date.

sudo apt update && sudo apt upgrade -y

Install Dependecies

To complete the installation, you will need to install the following software packages by using the following command in your terminal.

sudo apt install software-properties-common apt-transport-https curl wget -y

If you are unsure, run the command; it will not harm you.

These are the most common software packages found on nearly all Linux distributions.

Import GPG Key and Visual Studio Repository

First, you will need to import the Microsoft GPG key to verify the authenticity of the installation package:

wget -q https://packages.microsoft.com/keys/microsoft.asc -O- | sudo apt-key add -

Secondly, import the Microsoft Visual Source Repository with the following command your terminal:

sudo add-apt-repository "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main"

Install Visual Studio Code

With the source repository sorted, you must refresh your apt 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 apt update

Now install Visual Studio with the following command:

sudo apt install code

To confirm the installation, you can use the verify version command as follows:

code --version

Example output:

1.63.2
899d46d82c4c95423fb7e10e68eba52050e30ba3
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:

code

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 the desktop to open with the path: Applications > Search > Visual Studio Code.

Example:

Install Visual Studio Code (VS Code) on elementary OS 6

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

Example:

Install Visual Studio Code (VS Code) on elementary OS 6

Select the theme you want. Dark is the default and is the most popular, but the tutorial white will be chosen to change the default.

Click Mark Done on the bottom left-hand side.

Once done, you will be taken to the default opening window.

Example:

Install Visual Studio Code (VS Code) on elementary OS 6

Congratulations, you have installed Microsoft Visual Studio Code.

How to Remove (Uninstall) Visual Studio Code

To remove the Visual Studio software from your system, run the following command in your terminal:

sudo apt remove code --purge

Then for complete removal, delete the repository and GPG key:

sudo rm /etc/apt/sources.list.d/vscode.*
sudo rm /etc/apt/trusted.gpg.d/microsoft.gpg

Comments and Conclusion

The guide has shown you how to install Microsoft Visual Code for elementary OS 6 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.



Follow LinuxCapable.com!

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