How to Install Visual Studio Code on Ubuntu 22.04/24.04

install vs code on ubuntu

Visual Studio Code or VS Code is a source code editor developed by Microsoft in 2015. It is a cross-platform tool and can be installed on Windows, Linux, macOS, and web browsers. It can work with various programming languages including Python, Rust, C/C++, C#, Fortran, Java, JavaScript, Go, HTML/CSS, PHP, YAML, and JSON etc. The tool offers several features like debugging support, IntelliSense for auto code completion, syntax highlighting, code refactoring( improving code readability, complexity, and maintainability), snippets, and built-in Git. You can change the theme, keyboard shortcuts, preferences, and can add extensions to enhance the functionality.

The objective of this tutorial is to teach you the methods to install Visual Studio Code on Ubuntu 22.04/24.04 LTS systems.

Prerequisites

An Ubuntu 22.04/24.04 instance (1.6 GHz or faster processor, 1 GB RAM, 500 MB Harddisk)

Root/Sudo privileges

Install Visual Studio Code on Ubuntu

There are many ways you can utilize to install Visual Studio Code on Ubuntu 22.04/24.04 LTS. We will look into each method one by one.

Install Visual Studio Code through Snap

Open up the terminal either through Show Apps or by using CTRL + ALT + T shortcut key.

The first method we are exploring for Installing VS code is by using snap package manager. Snap are software packages developed by Canonical (the company behind Ubuntu) primarily for Ubuntu but now they are available for all major Linux distributions. Security, ease of management, and bundle dependencies are some of the benefits of snap.

Run the command on the terminal to install VS Code.

sudo snap install code --classic

Install Visual Studio Code through flatpak

The second method to install VS Code is through flatpak package manager. Flatpak is a tool for software deployment and package management on Linux systems. It works in a separate sandbox environment in which users can install and run applications.

Invoke the apt command to install flatpak on your machine.

sudo apt install flatpak

After installing flatpak, run the command to install VS code.

flatpak install https://dl.flathub.org/repo/appstream/com.visualstudio.code.flatpakref

Once VS Code is successfully installed, you can start it from Show Applications by searching “vs code”. (You many need to reboot your system).

Install VS Code through .deb package

In your favorite browser (In my case, it is Mozilla Firefox), open the VS Code official site code.visualstudio.com. Once a site is opened, download .deb package and save it in your system.

Go to the location where a file is downloaded, and double-click it. Follow the step-by-step instructions. (Alternatively, you can open the terminal and run the command.

sudo apt install ~/Downloads/code_*.deb

Uninstall VS Code from Ubuntu

Removing a Visual Studio Code depends on how you install it. If you have installed it through snap, run on the terminal:

sudo snap remove code

Similarly, if you have installed VS Code with flatpak you may uninstall it using:

flatpak uninstall --delete-data com.visualstudio.code

Conclusion

So you have read that you can install Visual Studio Code with the help of .deb file, snap, and flatpak package managers. We hope you liked our article. Do not forget to share it with your circles. Keep following Linux World.