Easy Guide to Install Visual Studio Code on Ubuntu

How to install VS Code on Ubuntu

A British company named Canonical launched Ubuntu in 2004. It was built on the base of Debian, a popular but challenging-to-install version at the time. Consequently, Ubuntu came out as a more approachable substitute. Ubuntu is the most popular free, open-source operating system which is based on Linux. In 2004, its initial version was released. Ubuntu meets the needs of a variety of users, ranging from personal computers to servers and Internet of Things devices, with multiple editions available, such as the Desktop Edition, Server Edition, and Core Edition. Because Ubuntu is open-source software, users can freely alter its code, make multiple copies, and share customizations without paying a license fee.  In this guide, we share detailed information on how to install VS Code on Ubuntu, at the end you will successfully set up VS Code on your Ubuntu operating system.

Ubuntu Installation Guide for Visual Studio Code 

When it comes to configuring and using many programming languages on a single platform, Visual Studio Code is the perfect tool for developers and programmers alike. 

Microsoft Visual Studio Code is an open-source code editor that is powered by Microsoft, as the name suggests. The end users are provided with an abundance of debugging alternatives, such as integrated Git control, syntax highlighting, code completion, code refactoring, an integrated terminal, snippets, and much more. A few other rivals in the market provide end users with a coding facility and structure similar to Visual Studio Code. How would you decide between the two, for instance, if you were to compare Visual Studio Code with Atom, its closest rival? This is where the real understanding of identification emerges.  

Visual Studio Code is compatible with Linux distributions as well as Windows and macOS. Installing Visual Studio Code on Ubuntu can be done in three main ways, although the process varies according to the Linux distribution.  

  1. Using the Snap package, install it using the terminal. 
  2. Combine Microsoft’s package repository with apt. These repositories are geared mostly towards Linux users.
  3. Install the program on your PC using Ubuntu’s graphical user interface.

Using one of these three approaches, you can install Visual Studio Code on Ubuntu:  

1. Using the Ubuntu Terminal to Install the VS Code Snap Package – 

Snaps: What are they? These are software packages that are self-contained and contain the binary along with all the dependencies required to execute the application. Snap packages are safe and simple to update. The Linux snap package for Visual Studio Code is updated and maintained by Microsoft. Both the Snap Store and the Snap installation mechanism are packed with features that support different program installations. Snaps can be installed via Ubuntu Software or the command line. 

Launch the terminal and enter the following command to begin the installation of the Visual Studio Code snap package:  

sudo snap install -- classic code 

This completes the installation; Visual Studio Code can now be opened from the Applications menu or the terminal. Enter the code for the keyword to open it immediately through the terminal. 

Code 

You may also use the search box to type in Visual Studio Code and then click on the icon to open it from the Applications menu.  

Using the Snap Technique, remove Visual Studio Code  

The following command can be used in the terminal window to remove the Snap package for Visual Studio Code: 

sudo snap remove code 

2. Install VS Code on Ubuntu Through APT

An alternative is to use Ubuntu’s built-in package manager, apt, along with Microsoft’s repository to install Visual Studio Code. Use the official repository to install the software by following these procedures. 

Step 1: Be sure to upgrade and update your current packages.
Using the commands below, first update every package on your system:  

sudo apt update 
sudo apt upgrade –

Step 2: Set up the dependencies for the repository.  
You need to install the dependencies needed to add the repository after you’ve upgraded and updated the packages. Put this command into your terminal: 

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

Step 3: Open the Microsoft GPG Key.  
Next, import Microsoft’s GPG key using wget: 

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

Step 4: Make the VS Code Repository accessible.  
Execute the following command to enable the VS Code repository: 

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

Step 5: Use the apt Command to install Visual Studio Code  
Use the following command to install the software package as soon as you enable the repository: 

sudo apt install code –y 

Upgrade the Version of Software You Currently Have  

Use the update/upgrade commands as follows to update your current version of VS Code to the most recent version that is available: 

sudo apt update && sudo apt upgrade –y 

Your current version will be updated by the most recent release once this detects the newest versions that are available. The installed version can be verified by using the –version command after installation, as demonstrated below:  

code –version 

Delete the Visual Studio Code Using APT  

Using the appropriate procedure makes the eradication process quite simple. To complete the task, input the following command into the terminal window: 

sudo apt auto-remove code 

3. Install Visual Studio Code Using the GUI

The Ubuntu GUI allows you to install Microsoft Visual Studio Code as well. The desktop environment is your next best bet if you’re not a fan of the terminal for package installation.  

Open the Ubuntu Software application from the Applications menu to install Visual Studio Code. Choose the first result from your code search. Click Install after that. 

After the installation is finished, you can launch Visual Studio Code directly from the Applications menu or through the terminal.  

Using The Software Centre, Uninstall Visual Studio Code  

Go to your Ubuntu computer’s Software Center and choose the Visual Studio Code installation to uninstall from the application window. Navigate to the top of the screen’s Installed tab. To remove the Code icon, scroll to it and select the Uninstall option.  

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top