Install Microsoft Visual Studio Code In Linux

Install Microsoft Visual Studio Code In Linux

Microsoft Visual Studio Code is an open source, lightweight and powerful source code editor. It comes with built-in support for JavaScript, TypeScript and Node.js and has a rich ecosystem of extensions for other languages (such as C++, C#, Python, PHP, Go) and runtimes (such as .NET and Unity). It is a cross-platform code editor, so you can use it in Microsoft Windows, GNU/Linux, and Mac OS X.

In this tutorial, we are going to see how to install latest Visual Studio Code editor in Linux.

Install Microsoft Visual Studio Code In Linux

Microsoft developers has made VS Code repositories for different Linux distributions to ease the installation.

On Ubuntu and its derivatives, run these commands to to import singing key VS Code repository:

$ curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
$ sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg
$ sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list'

Then, update the repository lists and install VS Code as shown below.

$ sudo apt-get update
$ sudo apt-get install code

On RHEL, CentOS, Fedora, run the following commands to import singing key VS Code repository:

$ sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
$ sudo sh -c 'echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" > /etc/yum.repos.d/vscode.repo'

Update the package cache and install VS Code as shown below.

$ yum check-update
$ sudo yum install code

On SUSE/openSUSE, run the following commands to import singing key VS Code repository.

$ sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
$ sudo sh -c 'echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ntype=rpm-md\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" > /etc/zypp/repos.d/vscode.repo'

Update the package cache and install VS Code as shown below.

$ sudo zypper refresh
$ sudo zypper install code

On Nix OS:

$ nix-env -i vscode

Once installed, you can open the VS Code editor using command:

$ code

If you see a screen something like below, congratulations! You have successfully installed Microsoft Visual Studio Code in your Linux distribution.

Microsoft Visual Studio Code Editor

You can make VS Code as default text editor for text files with the following command:

# xdg-mime default code.desktop text/plain

I have installed MS Visual Studio Code, now what? Refer the following links to getting started with Visual Code.

And, that’s all for now. Have you tried Visual studio in Linux? What is your thoughts about it? Give us your feedback in the comment section below.

Cheers!

Resource:

Thanks for stopping by!

Help us to help you:

Have a Good day!!

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *