How to Uninstall and Reinstall Visual Studio Code (Windows, macOS, Linux)

How to Uninstall and Reinstall Visual Studio Code (Windows, macOS, Linux) - GuidingCode

Whether you’re attempting to remove, uninstall or completely reinstall Visual Studio Code (VS Code) and its settings on your Windows, macOS or Linux (Ubuntu) machine, this simple guide provides the steps to achieve this.

Visual Studio Code is a code editor developed by Microsoft for Windows, Linux, and macOS. It can be used for various purposes but it’s especially synonymous with web development and programming with Javascript. Besides that, Visual Studio Code also offers features such as debugging and version control among many more.

Additionally, Visual Studio Code also has a large number of extensions available in the extensions marketplace which enables developers to add on additional features and tweak the editor according to their preferences. All of this and much more makes Visual Studio Code a strong contender for being one of the best source-code editors available to developers and programmers of different specialities.

How to Uninstall and Reinstall Visual Studio Code (Windows, macOS, Linux) - GuidingCode

 

However, the Visual Studio Code program may experience problems or display various error messages as its settings conflict with the system, or if it wasn’t updated or installed correctly. Thus, if its installation is corrupted you may notice that no matter what you try, the program doesn’t launch. So, an effective fix for various VS Code issues is to completely reinstall it along with its settings.

Visual Studio Code "Failed to install update" error message

 

That being said, when it comes to uninstalling Visual Studio Code from our machines and reinstalling a fresh version, we might realize that our settings and preferences remain the same. This is because, in addition to uninstalling Visual Studio Code from our machines, we also have to delete its settings and data for a complete reinstall. This takes a few more steps.

In this guide, we’ll go over how to not only uninstall Visual Studio Code, but also its settings on Windows, Linux, and macOS. Furthermore, we will also look at how to reinstall Visual Studio Code on the aforementioned operating systems to ensure that you’re running a new and fresh version. 

 

 

Steps to Uninstall and Reinstall Visual Studio Code on Windows

If you would like to uninstall the Visual Studio Code program on a Windows machine:

  1. First, visit the following path using File Explorer, which is where Visual Studio Code is installed:
C:\Users\User\AppData\Local\Programs\Microsoft VS Code

completely uninstalling Visual Studio Code to reinstall it on Windows

 

  1. Next, locate the unins000.exe file and double-click to open it.

completely uninstalling Visual Studio Code to reinstall it on Windows

 

  1. Then, a popup should appear asking if you want to remove the application and its components. Here, click Yes.

completely uninstalling Visual Studio Code to reinstall it on Windows

 

  1. To reset Visual Studio Code’s settings, visit the following path and delete the Code folder: 
C:\Users\User\AppData\Roaming

completely uninstalling Visual Studio Code by deleting cache files and settings to reinstall it on Windows

 

  1. Next, visit the following path and delete the .vscode folder: 
C:\Users\User

completely uninstalling Visual Studio Code by deleting cache files and settings to reinstall it on Windows

 

This should uninstall Visual Studio Code and reset its settings from your Windows machine. In order to install it again: 

  1. For starters, visit the download page here and click the download button for Windows.

downloading Visual Studio Code installation file from official downloads page to reinstall it on Windows

 

  1. After that, click on the download from your browser’s Downloads page to open it.

reinstalling Visual Studio Code on Windows by opening downloaded installation file

 

  1. Accept the agreement.

reinstalling Visual Studio Code on Windows

 

  1. Next, select the path where you would like VS Code to be installed.

reinstalling Visual Studio Code on Windows

 

  1. Following that, you have to select the Start Menu folder. You can also check the box at the bottom left if you don’t want a start menu folder.

reinstalling Visual Studio Code on Windows

 

  1. Subsequently, you can select any additional preferences you would like together with your brand new installation of Visual Studio Code.

reinstalling Visual Studio Code on Windows

 

  1. Finally, verify all the selections made and click Install.

reinstalling Visual Studio Code on Windows

 

With that done, Visual Studio Code should be successfully installed! Click Finish and check the Launch Visual Studio Code box to open and start using VS Code.

reinstalling Visual Studio Code on Windows

 

Steps to Uninstall and Reinstall Visual Studio Code on Linux

The following are steps to uninstall Visual Studio Code on a Linux machine, and in this example, we’re using a device running Ubuntu:

 

Uninstalling Using Terminal Commands (Snap, APT)

If you installed VS Code using a Snap:

sudo snap remove vscode

 

If you installed VS Code using apt:

sudo apt-get purge code

 

Additionally, you can remove any custom configurations or settings made on the Visual Studio Code program by entering the following command:

cd ~ && rm -rf .vscode && rm -rf .config/Code

 

Uninstalling Using the Ubuntu Software Center

If you installed VS Code using the Ubuntu Software Center, open the Ubuntu Software, then within the Installed category, search for the app, right-click it and select Remove.

completely uninstalling Visual Studio Code using Ubuntu Software Center to reinstall it on Ubuntu Linux

 

Uninstalling Using the File Manager

For this method, you can start by renaming the following file, to render it ineffective but kept as a backup while ensuring that the program creates a new version:

~/.config/Code/User/settings.json

 

Moving on, you can either move or delete the following folders:

~/.config/Code

~/.vscode

 

Any of the above steps should uninstall Visual Studio Code and its settings from your Linux machine. With that done, the following ways can be used to reinstall it on Ubuntu: 

 

Installing From the Official Visual Studio Code Downloads Page

One way to install the Visual Studio Code program on your Linux machine is by downloading its file from their official downloads page. Here, you can choose to download the file suitable for your device’s particular distro, whether it’s running Ubuntu, Debian, Red Hat, etc.

downloading Visual Studio Code installation file from official downloads page to reinstall it on Linux

 

Installing Using the Ubuntu Software Center

As you might know, the Ubuntu Software Center is a package management system with a graphical user interface, so it’s sort of like an app store that’s easy to access and navigate on your device. Here, you can also find the Visual Studio Code program to download and install.

Simply search for the Visual Studio Code application, open its page, and select the Install button. Afterwards, you may need to authorize the download by entering your system user password.

reinstalling Visual Studio Code using Ubuntu Software Center on Ubuntu Linux

 

Installing as a Snap Package

A snap is a safe and easy to install software package on Linux that is containerized. So, the Visual Studio Code snap can be installed by entering the following command in the Terminal:

sudo snap install --classic code

 

Installing Using Advanced Packaging Tool (APT)

Before installing VS Code using APT, there are a number of steps we need to follow. 

  1. Firstly, update the packages on your machine by entering the following command in the terminal:
sudo apt update

 

  1. Next, install the depository’s required dependencies by entering the following command:
sudo apt install software-properties-common apt-transport-https wget

 

  1. After that, import Microsoft’s GPG key by entering the following command:
wget -q https://packages.microsoft.com/keys/microsoft.asc -O- | sudo apt-key add -

 

  1. Then, enable the Visual Studio Code repository:
sudo add-apt-repository "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main"

 

  1. Lastly, install the Visual Studio Code package:
sudo apt install code

 

Steps to Uninstall and Reinstall Visual Studio Code on macOS

If you would like to uninstall Visual Studio Code on a macOS machine:

  1. Start by deleting the Visual Studio Code app from the Applications folder in Finder.

completely uninstalling Visual Studio Code to reinstall it on macOS

 

  1. Once the app itself has been deleted, enter the following commands into the Terminal to delete and reset VS Code’s settings:
rm -rf ~/Library/Preferences/com.microsoft.VSCode.helper.plist 

rm -rf ~/Library/Preferences/com.microsoft.VSCode.plist 

rm -rf ~/Library/Caches/com.microsoft.VSCode

rm -rf ~/Library/Caches/com.microsoft.VSCode.ShipIt/

rm -rf ~/Library/Application\ Support/Code/

rm -rf ~/Library/Saved\ Application\ State/com.microsoft.VSCode.savedState/

rm -rf ~/.vscode/

 

  1. If you would also like to delete any hidden folders in the home directory, enter the following command:
rm -rf ~/.vscode*

 

The above steps should successfully uninstall Visual Studio Code and its settings from your macOS machine. Once that’s done, the following steps can be used to reinstall it on macOS

  1. First, download Visual Studio Code for macOS here.

downloading Visual Studio Code installation file from official downloads page to reinstall it on macOS

 

  1. Then, open the downloaded archive from your browser’s downloads.

reinstalling Visual Studio Code on macOS by opening downloaded installation file

 

  1. After that, extract the archive and drag Visual Studio Code app to the Applications folder.
  2. Additionally, for easier access, VS Code can be added to the Dock by right-clicking the icon and selecting Options > Keep in Dock.

saving Visual Studio Code app to dock for easier access on macOS

 

Conclusion

To recap, completely uninstalling Visual Studio Code from your machine can be somewhat tricky at first. However, it is straightforward once you know the additional steps that need to be taken.

Some may want to completely uninstall Visual Studio Code from their machine just as a way of restarting fresh to resolve application errors or they may want to switch to a different code editor or IDE. Whatever the reason is, this is the perfect guide for you!

In this article, we looked at how to completely uninstall Visual Studio Code and delete its settings on Windows, Linux, and macOS devices. Additionally, we also looked at how to reinstall it on each of the above platforms after uninstalling it.

Having said that, we hope you’ve found this guide helpful when it comes to completely uninstall and reinstall Visual Studio Code.

Feel free to share this post with your fellow coders to guide them through reinstalling Visual Studio Code!

Total
0
Shares
Leave a Reply

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

Total
0
Share