Gỡ cài đặt visual studio 2023

Gỡ cài đặt visual studio 2023

VS Code is a popular code editor that many developers use and love it. However, it can irritate developers at times, such as when attempting to completely uninstall VS Code. So, if this is your issue, I will provide a proper guide for completely uninstalling vs code in Windows, Mac, and Linux.

Table of Contents

  • Why is Visual Studio Code not completely uninstalled?
  • Uninstalling Visual Studio Code in Windows OS
  • Uninstalling Visual Studio Code in Windows OS using Third-party Software
  • Uninstalling Visual Studio Code in Linux
  • Uninstalling Visual Studio Code in Mac
  • Uninstalling Visual Studio Code in Mac using Third-party Software

Why is Visual Studio Code not completely uninstalled?

Most applications are normally uninstalled by simply uninstalling them through the control panel or with a single uninstalled command in Linux and Mac. However, this does not happen in VS CODE because its settings, plugins, and extensions are stored in a separate location than your VS CODE installation files location. VS Code has done this so that if a developer later encounters a problem with VS Code, the settings will be retained, and if the developer uninstalls and reinstalls then the same settings will be applied automatically, eliminating the need to reconfigure each and every setting on each install/reinstall process.

Uninstalling Visual Studio Code in Windows OS

All of those settings were saved by Windows OS in the AppData (also known as Application Data) Folder. AppData folders are usually hidden.
It provides settings and other information that PC system apps require for operation, as well as settings for third-party applications such as VS Code.

To uninstall VS Code completely follow the below steps:

📑 Note: Here I am using Windows 11 and this works for Windows 10, Windows 8.

1 Close VS Code Editor ( if you are using it)

2 Go to search, type vscode, and then select "Visual Studio Code" from the list.

3 Right-click on 'Visual Studio Code' and select "Uninstall".Now this will open Control Panel.

Gỡ cài đặt visual studio 2023
fig. select "uninstall" option

4 In the control panel, look for Visual Studio Code and right-click it. Then, select "Uninstall" and follow the instructions to uninstall it.

Gỡ cài đặt visual studio 2023
fig. Uninstall vscode from the control panel

This will uninstall the vs code software from your computer. But user settings, extensions, and plugins related to vscode are still there. let's delete them as well.

5 Goto windows explorer and type:

 %UserProfile% 

and look for .vscode. If there is no .vscode file in the folder, they are hidden; simply unhide and delete the .vscode folder.

Gỡ cài đặt visual studio 2023
fig. remove .vscode folder

6  Again go to windows explorer and type:

%AppData%\Code

 and delete everything contained within it.

Gỡ cài đặt visual studio 2023
fig. remove everything from code folder

7 Again go to Windows Explorer and type:

%LocalAppData%\Programs\Microsoft VS Code

and delete everything from here.

Note that you have installed vscode in another folder then you will not get this folder so in this case, you have to find a location where vscode is installed and there find the "Microsoft VS Code" folder and delete all the contents present inside it.

Uninstalling Visual Studio Code in Windows OS using Third-party Software

If removing vscode becomes too hard, you can use a third-party application to do so. Revo Uninstaller is a popular third-party application for uninstalling applications. It has the ability to completely and cleanly remove applications. It includes both free and paid features. It is always preferable, to begin with, free features.

Also, there are many other uninstallers you can try it like:

  • IObit Uninstaller Free
  • Wise Program Uninstaller
  • Geek Uninstaller

Uninstalling Visual Studio Code in Linux

In a Linux-based machine, simply type the following command into the terminal.

sudo apt-get --purge remove code  

It will prompt you for your password; simply enter your password and press 'Enter'.

📑 Note: Don't forget to use the double minus sign before the purge.

This command will uninstall vscode as well as remove all configuration files.

There may also be packages on which vscode relied that are no longer in use. So, use the "autoremove" command to remove those packages as shown below:

sudo apt-get autoremove

It will prompt you for your password; simply enter your password and press 'Enter'.

Now close the terminal and again try to install fresh install visual studio code, it will be installed with default settings and configuration.

You can also combine those two commands in a single line as shown below:

sudo apt-get purge --auto-remove code

📑 It is important to note that simply typing sudo apt remove code will not work because it will not delete the user's configuration files. If you want to delete everything, always use the purge command.

You can also use the following dpkg command if apt is not working.

sudo dpkg --remove visual-studio-code
sudo dpkg --purge visual-studio-code

Uninstalling Visual Studio Code in Mac

VS Code settings, extensions, and caches are stored in the following locations:

  •  ~/Library/Preferences/com.microsoft.VSCode.helper.plist
  • ~/Library/Preferences/com.microsoft.VSCode.plist 
  • ~/Library/Caches/com.microsoft.VSCode.ShipIt/
  • ~/Library/Caches/com.microsoft.VSCode
  • ~/Library/Application\ Support/Code/
  • ~/Library/Saved\ Application\ State/com.microsoft.VSCode.savedState/
  • ~/.vscode/

Here are the steps for uninstalling vscode completely in MacOS:

1 Close VS Code Editor ( if you are using it).

2 In terminal type following rm command one by one with great care.

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/

With the help of the rm command, the files will be deleted. Also -fr or -rf are also used in combination with rm. Actually -fr is the combination of two distinct arguments "-r" and "-f". Its works are as follows:

  • -r: This argument helps to remove files as well as a folder, subfolders, subfiles soon.
  • -f: This argument helps to remove those files and folders without any prompt for confirmation. So, -f helps to skip the permission required to delete the contents.

Uninstalling Visual Studio Code in Mac using Third-party Software

You can use a third-party app like PowerMyMac Uninstaller or Delete Apps: Uninstaller to automatically remove the VSCode application along with its settings, extensions, and plugins. They make it easier to find and remove applications. It is also beneficial to delete both apps as well as all associated library files (settings, configurations, caches, log, preferences, and so on)

Conclusion

In this manner, we can easily remove vs code software along with its settings, configurations, extensions, caches, and log. From this article, you should have learned why vscode kept those settings and how to completely uninstall vs code.