×


Install Visual Studio Code on Linux Mint 20 - Step by step guide ?

Visual Studio Code, also colloquially referred to as VS Code, is a free and cross-platform code editor from the Microsoft Company. It's an extremely popular code editor thanks to its neat and user-friendly UI and a wide selection of features and numerous plugins which extend its functionality. VS Code supports a wide selection of languages such as Python, Java, C, C++, Go, Lua, PHP, JavaScript, TypeScript and so much more. It even supports frontend languages such as HTML, and CSS.

Here at Ibmi Media, as part of our Server Management Services, we regularly help our Customers to perform related Visual Studio Code queries.

In this context, we shall look into the different methods of installing VS Code on Linux Mint 20. 


Different ways of installing Visual Studio Code on Linux Mint 20

  • Microsoft Visual Studio Code installation via snap.
  • Microsoft Visual Studio Code installation from the Microsoft repository.


1. Microsoft Visual Studio Code installation via snap

This is the easiest way of installing VS Code on Mint 20. To begin, launch your terminal and update the package Index on your Mint 20 installation with the below command:

$ sudo apt update -y 

Once the system is up to date, the next step will be to enable snap on Mint 20 since Mint 20, by default, does not come with snap enabled.

Before you do so, remove the nosnap.pref file:

$ sudo rm /etc/apt/preferences.d/nosnap.pref

Once again, refresh the package index with the command:

$ sudo apt update -y 

Next, enable snap on your system. In this case, snap is already installed:

$ sudo apt install snapd

Next, install VS Code using snap:

$ sudo snap install code –classic

To verify that VSCode is installed, check its version with the below command:

$ code —-version


2. Microsoft Visual Studio Code installation from the Microsoft repository

To use this installation method, begin by installing the dependencies with the below command:

$ sudo apt install curl software-properties-common apt-transport-https 

Next, import the GPG signing key by executing the following commands:

$ curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg

Next, execute the command:

$ sudo install -o root -g root -m 644 microsoft.gpg /etc/apt/trusted.gpg.d/

Next, create a repository file and add the VS Code APT repository. Here, the repository is defined in the vscode.list file inside the /etc/apt/sources.list.d directory:

$ sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list'

Then sync the new repository by refreshing your Mint system's package index:

$ sudo apt update

Finally, install VSCode on Mint 20 using APT:

$ sudo apt install code


How to launch Visual Studio Code ?

Now, to launch VS Code, execute:

$ code &

This launches VS Code in the background and still frees up your terminal. Once launched, you can now get started coding your applications or websites.


[Need help in fixing Linux Mint system Software Installation issues ? We can help you. ]


Conclusion

This article covers the complete installation procedure of VS Code on Linux Mint 20. In fact, Visual Studio Code provides comprehensive code editing, navigation, and understanding support along with lightweight debugging, a rich extensibility model, and lightweight integration with existing tools.