How to Install Visual Studio Code on Ubuntu 22.04

0

Visual Studio Code (VS Code) is an open-source, cross-platform code editor that helps programmers quickly and easily write code in various programming languages, including Python and JavaScript.

VS Code supports debugging, embedded Git Control, syntax highlighting, and code completion features similar to Atom editor.

Here, we will see how to install Visual Studio Code on Ubuntu 22.04.

Install Visual Studio Code On Ubuntu 22.04

VS Code is available from the Snap store and Microsoft’s official repository for installation.

Install VS Code from Microsoft Repository

Update the repository index and then install HTTPS support for apt.

sudo apt update

sudo apt install -y curl apt-transport-https

Next, download and import the Microsoft signing GPG key.

curl -sSL https://packages.microsoft.com/keys/microsoft.asc | sudo gpg --dearmor -o /usr/share/keyrings/ms-vscode-keyring.gpg

Now, add the Microsoft Visual Studio Code repository to your system.

echo "deb [arch=amd64 signed-by=/usr/share/keyrings/ms-vscode-keyring.gpg] https://packages.microsoft.com/repos/vscode stable main" | sudo tee /etc/apt/sources.list.d/vscode.list

After adding the VS code repository, update the repository index.

sudo apt update

Finally, use the below command to install the Visual Studio Code.

sudo apt install -y code

Install Visual Studio Code from Snap Store

VS Code is now available as snap packages from the Snap store, and you can install it with the below commands.

sudo snap refresh

sudo snap install code --classic

Launch Visual Studio Code

Once the VS Code is installed on your system, you can launch it by running code in the terminal or going to Activities >> Search for Visual Studio Code.

You will get the Get started with VS code window on the first launch.

Visual Studio Code On Ubuntu 22.04
Visual Studio Code On Ubuntu 22.04

Update Visual Studio Code

Microsoft releases the update every month for VS Code. So, you can follow the below steps to keep the Visual Studio Code updated.

Update VS Code from Microsoft Repository:

sudo apt update

sudo apt --only-upgrade install code

Update VS Code from Snap Store:

sudo snap refresh code

Conclusion

That’s All. You have successfully installed Visual Studio Code on Ubuntu 22.04. Now, you are ready to install extensions and customize VS Code according to your preferences.

You might also like