Jannah Theme License is not validated, Go to the theme options page to validate the license, You need a single license for each domain name.
Linux

How to Install Visual Studio Code on Ubuntu?

Introduction 

As an esteemed code editor, Microsoft’s VScode is a tool developers gravitate towards for its exceptional functionality in editing source code. What’s more, VScode is compatible with the three major operating systems – Windows, macOS, and Linux. This means that its clean and user-friendly interface can be accessed regardless of your preferred OS, making it highly compatible with Linux-based OS, Ubuntu in particular. 

Unlike Ubuntu’s built-in command-line-interface text editors, Nano and Vim, Visual Studio is a GUI code editor. To ensure uninterrupted usage, it is important to have the supported version of Ubuntu OS and to update Visual Studio once installed from the official Microsoft repository regularly. If you’re looking to delve into the technical details of how to install Visual Studio code on Ubuntu, then let’s explore further!

How to Install Vscode on Ubuntu? 

To install Visual Studio code on Ubuntu, you need a terminal (text-based interface like command-kline-interface). Follow the following steps to install Visual Studio from the terminal

  • Open the terminal window on your Ubuntu system.
  • Now you need to import the Microsoft GPG key (a digital signature tool) to sign the package. Use the below code to import the key.
curl -sSL https://packages.microsoft.com/keys/microsoft.asc |
gpg --dearmor > microsoft.gpg
How to Install Vscode on Ubuntu? 

sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg

How to Install Vscode on Ubuntu? 
  • After you have verified the authentification of the vscode, you need to add the vscode repository to Ubuntu’s software sources list. The following code will help you in adding the repository.
echo "deb [arch=amd64 signed-
by=/etc/apt/trusted.gpg.d/microsoft.gpg] 
https://packages.microsoft.com/repos/vscode stable main" | 
                sudo tee /etc/apt/sources.list.d/vscode.list
  • The next step involves the updation of the package list through the below code.
sudo apt update
How to Install Vscode on Ubuntu? 
  • The last step of this installation process of Visual Studio on Ubuntu involves the following code. 
sudo apt install code
How to Install Vscode on Ubuntu? 
  • When your installation is complete, simply type the command “code” in the terminal.
How to Install Vscode on Ubuntu? 

Also Read: How to Format a Disk in Linux/Ubuntu OS?

How to Start Visual Studio on Ubuntu? 

Once you have properly installed Visual Studio in Ubuntu, you need to start the code editor. Follow the below steps to start the software tool quickly.

  • If you want to start the code editor directly through the application menu, then search Visual Studio or code in the menu. The application menu is present on the top-left corner of the screen.
  • Another method is to use the command-line interface. Search for the terminal through the application menu. Click on the terminal window and type ‘code.’ The Visual Studio will launch after you press enter. 

You can now enjoy the code editing software vscode.

Uninstall vscode 

Are your preferences shifted to other code editors, or do you simply have maintenance scheduled? In any case, you can easily uninstall vscode with the following steps. 

  • First of all, we will remove the vscode package by using this code in the terminal window. 
sudo apt remove code
Uninstall vscode 
  • After the vscode package is removed, you can run the below code to configure the files associated with the software tool.
sudo apt purge code
Uninstall vscode 
  • When you install vscode on Ubuntu, certain dependencies are also installed along with it. You can swiftly remove these dependencies with this code.
sudo apt autoremove
Uninstall vscode 

Also Read: How to Add a GUI to Ubuntu Server

Conclusion

Visual Studio is a highly impressive code editor that can be used on a variety of operating systems. One such system is Ubuntu, which is based on Linux. If you’re interested in installing vscode on Ubuntu, we’ve got you covered. Thanks to its active community support, you can easily install Visual Studio via the terminal window. However, it’s important to note that you will need to have the genuine Microsoft GPG key. 

Once you’ve successfully installed Visual Studio, you can access it through either the application menu or the terminal window. If you come across a better software tool or simply no longer need a code editor, removing Visual Studio is a breeze. You can quickly and easily remove the package and uninstall it within a matter of minutes. We hope that our article has provided you with both a clear understanding and detailed instructions.

Arpit Saini

He is the Director of Cloud Operations at Serverwala and also follows a passion to break complex tech topics into practical and easy-to-understand articles. He loves to write about Web Hosting, Software, Virtualization, Cloud Computing, and much more.

Related Articles