Installing Microsoft Visual Studio Code on Ubuntu and Other Linux

Microsoft’s open-source code editor, Visual Studio Code, is remarkable. Learn how to install VS Code on Ubuntu and other Linux distros.
Warp Terminal

Microsoft did the unexpected by releasing Visual Studio Code for all major desktop platforms, that includes Linux as well. Soon after its release, Microsoft Visual Code became one of the best open source code editors. The features it provides are useful not only to web developers, but for all kinds of programmers.

I am not going to list the features of Visual Studio Code here. I presume you already know them. So, here, I am going to show you how to install Visual Studio Code on Ubuntu and other Linux distributions.

  • Snap version: Snap are the universal packaging format. You can find this version in the software center. Usually, Snap applications take longer to start but they get quicker updates automatically.
  • Deb version: Traditional debian package (.deb file) that you have to download from VS Code's website and then install it on your system. Newer versions are provided with system updates.

Method 1: Install Visual Studio Code on Linux using Snap

Visual Studio Code is available as a Snap package. Ubuntu users can find it in the Software Center itself and install it in a couple of clicks.

Stable and Testing version of VS Code Snap application in Ubuntu Software Center
Visual Studio Code in Ubuntu Software Center

Snap packaging means you can install it in any Linux distribution that supports Snap packages. Make sure to enable Snap support on your Linux distribution if you haven’t done already.

sudo snap install code --classic
Install VS Code snap application through command line
Install VS Code Snap App

The installation will depend on your internet connection speed.

Remove VS Code Snap

You can remove VS Code installed as a snap both through software center and terminal.

Open the Software Center and browse VS Code in the “installed” apps section. Click on remove to uninstall it.

Remove the VS Code Snap application through Software Center
Remove VS Code Snap

Or, open a terminal and enter the following command, it is that easy:

sudo snap remove --purge code

Method 2: Using the .deb/.rpm packages

Microsoft provides packages to install Visual Studio Code on Linux. Just head over to the download page of Visual Studio Code, and you’ll find the .deb and .rpm files options for the Linux platform.

💡
If you are running Ubuntu or any other Linux distribution based on Ubuntu such as Linux Mint, elementary OS etc., you need to opt for .deb file. .rpm is for Fedora and SUSE based Linux distributions.
Download the deb or rpm installation files from official Visual Studio Code downloads page
Download VS Code DEB or RPM

There are options for 32-bit systems as well. If you’re not sure about that, you can read our guide to find if your Ubuntu is 32 bit or 64 bit and then download the files accordingly.

Once downloaded, you can simply follow the method suitable to you to install a deb file on Ubuntu (or other Ubuntu-based distros).

Or, you can explore the right-click menu on the downloaded deb file and select open with software center.

If you do not find the option there, select Open with other applications and from and next, Software Install.

Right-click on the deb file adn select "Open With Software Install" to open it in Ubuntu Software Center
Open DEB File in Software Center

Now, press the “Install” button in the Software Center to install it.

Click on "Install" button in Software Center to install the VS Code deb file
Install VS Code Deb File

Suggested Read 📖

Use GDebi for Quickly Installing DEB Packages in Ubuntu
Gdebi is a tiny little app that helps you install deb files more effectively by handling dependencies. Learn how to use Gdebi and make it the default application for installing deb packages.

Remove VS Code deb/rpm app

Removing software that was installed from a .deb file is the same as removing any app from the Software Center.

Just go to the Ubuntu Software Center, search for the application name and click on Uninstall to remove it.

Alternatively, you can use Synaptic Package Manager if you do not find it listed on the Ubuntu Software Center for some reason.

Remove VS Code application installed through DEB file using Synaptic package manager
Remove VS Code Synaptic

Bonus Tip: Removing VS Code data

VS Code keeps some data on the disk. If you reinstall it, you'll find that your extensions and some other settings are still present.

If you want to remove all traces of VS Code from the system, you should also remove these application related files.

Usually, it creates .vscode folder in the home directory and a folder named Code in .config directory in your home directory.

You delete these folders and it should remove all presence of VS Code.

Conclusion

As a last resort, you can always build it from the source code. You can find the source code of VS Code on its GitHub page.

It’s pretty easy to install Visual Studio Code on Ubuntu, thanks to Snap, Flatpak, or deb/rpm packages available.

Now that you know — what method do you prefer to install Microsoft’s Visual Studio Code on Linux?

You are welcome to let me know your thoughts in the comments below!

If you are curious to explore alternatives and more options to code on Linux, here are some picks for you:

8 Best Open Source Code Editors for Linux
Looking for the best text editors in Linux for coding? Here’s a list of the best code open source code editors for Linux.
About the author
Abhishek Prakash

Abhishek Prakash

Created It's FOSS 11 years ago to share my Linux adventures. Have a Master's degree in Engineering and years of IT industry experience. Huge fan of Agatha Christie detective mysteries 🕵️‍♂️

Become a Better Linux User

With the FOSS Weekly Newsletter, you learn useful Linux tips, discover applications, explore new distros and stay updated with the latest from Linux world

itsfoss happy penguin

Great! You’ve successfully signed up.

Welcome back! You've successfully signed in.

You've successfully subscribed to It's FOSS.

Success! Check your email for magic link to sign-in.

Success! Your billing info has been updated.

Your billing was not updated.