Visual Studio Code is a powerful open-source code editor developed by Microsoft, and can be used on various platforms including Linux, Windows, and MacOS. It’s a powerful tool that helps debug code, execute tasks, and enable version control. It provides many features (Extensions) that differentiate it from other code editors, such as refactoring, syntax highlighting, automatic code completion, and snippets. In this article, you will learn how to install Visual Studio Code on Ubuntu 22.04.
1. Update System
Update the system to make it up to date.
$ sudo apt update && sudo apt upgrade -y
2. Install Packages
If your system has been updated, install the packages that must be installed before installing Visual Studio Code.
$ sudo apt install software-properties-common apt-transport-https wget -y
3. Import Repository
Add the Visual Studio Code repository to install Visual Studio Code. Before that, you will need to get a Microsoft GPG key to authenticate the installed packages.
$ wget -O- https://packages.microsoft.com/keys/microsoft.asc | sudo gpg --dearmor | sudo tee /usr/share/keyrings/vscode.gpg
$ echo deb [arch=amd64 signed-by=/usr/share/keyrings/vscode.gpg] https://packages.microsoft.com/repos/vscode stable main | sudo tee /etc/apt/sources.list.d/vscode.list
4. Update the System again
Now that you have installed the package and added the repository, perform the system update again.
$ sudo apt update
5. Install VSCode
Install Visual Studio Code.
$ sudo apt install code
Once installation is complete, enter code in the search box to check whether Visual Studio Code is installed.
The following is the execution screen of Visual Studio Code.