In the following article we are going to take a look at two ways to install Visual Studio Code on Ubuntu 20.04. For users who still do not know this program, we must tell them that Visual Studio Code is a free and open source code editor developed by Microsoft and that it is distributed under the MIT license.
Visual Studio Code is cross-platform, so we can find it available for Gnu / Linu, Windows and macOS. It is based on Electron and NodeJS for the desktop and runs on the Blink design engine.
This editor is also customizable, so users can set our configuration changing editor theme, keyboard shortcuts and preferences. It has built-in debugging support, built-in Git control, syntax highlighting, code completion, built-in terminal, code refactoring, and snippets.
Additionally, the editor comes with built-in support for JavaScript, TypeScript, and Node.js and has a rich ecosystem of extensions for other languages (like C ++, C #, Java, Python, PHP, Go, etc.) and execution times (like .NET and Unity).
Install Visual Studio Code on Ubuntu 20.04
In Ubunutu 20.04 we will be able to install VS Code as a snap package via the store Snapcraft or as a deb package from the Microsoft repositories. Here each user can choose the installation method that is most appropriate for their environment.
As a snap package
The Visual Studio Code package is distributed and maintained by Microsoft. Snaps are self-contained software packages that include the binary for all the dependencies required to run the application. Snap packages are easy to update and secure. These packages in Ubuntu can be installed from the command line or through the Ubuntu software application.
To install VS Code we will only have to open a terminal (Ctrl + Alt + T) and run the following command:
sudo snap install --classic code
After executing the previous command, Visual Studio Code should be installed on our Ubuntu 20.04 machine and we can start using it.
If you prefer to use a GUI for installation, there is nothing more than open Ubuntu software option and search 'Visual Studio Code'and install the application:
Every time a new version is released, the VS Code package will automatically update in the background.
As a .deb package using apt
Visual Studio Code is also available in the official Microsoft repositories. To install it we will only have to follow the following steps.
To start we will update package index and install necessary dependencies running the following command in a terminal (Ctrl + Alt + T):
sudo apt update; sudo apt install software-properties-common apt-transport-https wget
The next thing we will do is import the Microsoft GPG key using wget as follows:
wget -q https://packages.microsoft.com/keys/microsoft.asc -O- | sudo apt-key add -
At this point we can enable VS Code repository typing in the same terminal:
sudo add-apt-repository "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main"
Once the apt repository is enabled, we can start package installation typing:
sudo apt install code
When a new version is released, we will be able to update the VS Code package through the standard software update tool on our desktop. We will also be able to update it by executing the following commands in the terminal (Ctrl + Alt + T):
sudo apt update; sudo apt upgrade
Starting Visual Studio Code
After the installation, we can launch the program by typing in the Activities search bar 'Visual Studio Code'. We will only have to click on the icon to start the application.
When we start VS Code for the first time, a window like the following should appear:
Now we can start installing extensions and configure the VS Code according to our preferences.
VS Code can also be started from the command line typing:
code
At this point, we can start installing new extensions and customizing the workspace. For more information about VS Code, users can visit the page of official documentation, project websiteo the F.A.Q. of the project.
Hey.
In the title of the entry it says "Virtual" instead of "Visual" xD, xD.
A greeting.
Thanks for the notice xD.
The fact that it is from Microsoft has always thrown me back, it is clear that I have prejudices in this regard. And I learned how to use Sublime Text 3 to do the little things that I do in python and mel.
Anyway thanks for the article.
This is horrible, they want new developers to get used to their products so that free software tools die and end up developing in windows with visual studio. Is that you do not realize it !!!! ???
I recommend you try kdevelop or codelite or codeblocks or eclipse cdt. The first three are integrated with the distribution and are much better !!!
It seems to me a good tool to develop code, but you can also use others, for example codeblocks for co c ++, each language has a select code editor, but vscode integrates all of those to allow the programmer to stream within the same program and thus make it more efficient 🙂.
Hi I am something new in this, you say that the snap package will update automatically, the .deb is not updated? Should it be installed again or is it possible to update it?
Hello. Whether you use the snap package or you use the repository shown in the article, the program should be updated when you receive updates on the system, and program updates are received. No need to reinstall it again. Salu2.