How to Install Visual Studio Code on Ubuntu 22.04

Choose a different version or distribution

Introduction

Before we begin talking about how to install Visual Studio Code on Ubuntu 22.04, let's briefly understand – What is Visual Studio Code?

Visual Studio Code is a powerful and user-friendly source code editor developed by Microsoft. It is widely used by programmers and developers to write, debug, and test their code. With its intuitive interface and extensive features, Visual Studio Code supports various programming languages and offers built-in support for Git, making it a preferred choice for collaborative coding.

It provides a seamless coding experience with features like code completion, debugging tools, and customizable extensions. Whether you are a beginner or an experienced coder, Visual Studio Code simplifies the coding process and boosts productivity.

In this tutorial, we will explain two ways of installing Visual Studio Code on Ubuntu 22.04. We will also address a few FAQs on how to install Visual Studio Code on Ubuntu 22.04.

Advantages of Visual Studio Code

  1. Versatile: Supports numerous programming languages and platforms.
  2. User-friendly: Intuitive interface and easy-to-use features enhance productivity.
  3. Extensible: Customizable with a vast library of extensions for tailored coding experiences.
  4. Collaborative: Built-in Git support facilitates seamless team collaboration.
  5. Powerful: Offers code completion, debugging tools, and other advanced features for efficient coding.

Install Visual Studio Code as a Snap Package

Microsoft distributes and maintains the snap package for Visual Studio Code.

Snaps are complete software packages that include the binaries and all necessary dependencies to launch a program. Snap packages are safe and simple to update. Snaps have a bigger disc footprint and a slower startup time for applications than regular deb packages.

Snap packages may be set up using either the Ubuntu Software program or the command line.

Open your terminal (Ctrl+Alt+T) and type the following command to install the VS Code snap:

sudo snap install --classic code

That's all. Your Ubuntu computer has Visual Studio Code installed.

Open Ubuntu Software, look for "Visual Studio Code," and install the program if you prefer using a GUI.

The Visual Studio Code package will be automatically updated in the background each time a new version is made available.

Install Visual Studio Code with apt

The official Microsoft Apt repositories include Visual Studio Code. Take the following actions to install it:

Run the following command as a user with sudo permissions to update the package index and install the necessary dependencies:

sudo apt update
sudo apt install software-properties-common apt-transport-https wget

Employing the wget command shown below, import the Microsoft GPG key:

wget -q https://packages.microsoft.com/keys/microsoft.asc -O- | sudo apt-key add -

Add the following to the Visual Studio Code repository to activate it:

sudo add-apt-repository "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main"

Install the Visual Studio Code package when the apt repository has been made available:

sudo apt install code

You may update the Visual Studio Code package whenever a new version is published using either your desktop's default Software Update utility or by typing the following commands into your terminal:

sudo apt update
sudo apt upgrade

Starting Visual Studio Code

Enter "Visual Studio Code" in the Activities search box, then click the icon to start the program.

Now that you have installed the necessary extensions, you may customize VS Code to suit your needs.

Code may also be used to start VS Code from the command line.

FAQs to Install Visual Studio Code on Ubuntu 22.04

Can I install Visual Studio Code using a graphical interface?

Yes, you can install Visual Studio Code using a graphical interface. Visit the Visual Studio Code website, download the .deb package, and double-click on it to open and install using the Software Center.

Does Visual Studio Code require any additional software to run on Ubuntu 22.04?

Visual Studio Code requires a few dependencies to run properly, such as libasound2, libxss1, and libgtk2.0-0. These dependencies are usually installed automatically during the installation process.

Can I update Visual Studio Code on Ubuntu 22.04?

Yes, Visual Studio Code can be updated on Ubuntu 20.04 using the standard system update process. You will receive updates through the regular Ubuntu software updates.

Is Visual Studio Code available in the Ubuntu Software Center?

No, Visual Studio Code is not available in the Ubuntu Software Center. However, you can download the .deb package from the official Visual Studio Code website and install it manually.

Can I use Visual Studio Code for programming languages other than JavaScript?

Absolutely! Visual Studio Code supports a wide range of programming languages, including Python, C++, Java, HTML, CSS, and many more.

Are there any recommended extensions for Visual Studio Code on Ubuntu 22.04?

Yes, there are numerous useful extensions available for Visual Studio Code. Some popular ones include Python, GitLens, Bracket Pair Colorizer, and Live Server.

How can I uninstall Visual Studio Code from Ubuntu 22.04?

To uninstall Visual Studio Code, open the Terminal and run sudo apt remove code. This will remove the package from your system.

Conclusion

Hope this detailed tutorial helped you understand how to install Visual Studio Code on Ubuntu 22.04. Now that your workspace has been customized, you may begin installing new extensions.

If you have any queries, please leave a comment below, and we’ll be happy to respond to them.