DEV Community

Cover image for How to Completely Remove VS Code with All Configurations and Temporary Files
Sh Raj
Sh Raj

Posted on

How to Completely Remove VS Code with All Configurations and Temporary Files

How to Completely Remove VS Code with All Configurations and Temporary Files

Visual Studio Code (VS Code) is one of the most popular code editors, but there might come a time when you need to completely uninstall it from your system. This guide will walk you through the process of removing VS Code, including all configuration files, extensions, and temporary files, for macOS, Linux, and Windows. By following this article, you can ensure no residual files remain on your system.


For macOS

  1. Quit VS Code

    Before removing VS Code, make sure it’s not running. Open the Activity Monitor to check if there are any lingering VS Code processes and quit them if necessary.

  2. Remove the Application

    • Open the Applications folder.
    • Drag the Visual Studio Code.app to the Trash.
  3. Delete Configuration and Cache Files
    Open the Terminal and run the following commands to remove VS Code’s configuration files, caches, and saved states:

   rm -rf ~/Library/Application\ Support/Code
   rm -rf ~/Library/Caches/com.microsoft.VSCode
   rm -rf ~/Library/Caches/com.microsoft.VSCode.ShipIt
   rm -rf ~/Library/Preferences/com.microsoft.VSCode.plist
   rm -rf ~/Library/Saved\ Application\ State/com.microsoft.VSCode.savedState
Enter fullscreen mode Exit fullscreen mode
  1. Remove Extensions If you installed extensions, delete them with this command:
   rm -rf ~/.vscode
Enter fullscreen mode Exit fullscreen mode
  1. Empty the Trash
    • Go to the Trash.
    • Right-click and select Empty Trash.

For Linux

  1. Uninstall VS Code
    If VS Code was installed using a package manager, remove it using these commands:

    • For Debian/Ubuntu:
     sudo apt remove code
     sudo apt purge code
    
  • For Fedora/RHEL:

     sudo dnf remove code
     sudo dnf autoremove
    
  • For Arch-based Systems:

     sudo pacman -Rns code
    
  1. Remove Configuration and Cache Files Run these commands to delete VS Code’s configuration and cache files:
   rm -rf ~/.config/Code
   rm -rf ~/.vscode
   rm -rf ~/.cache/Code
Enter fullscreen mode Exit fullscreen mode
  1. Delete Extensions Remove any globally installed extensions:
   rm -rf ~/.vscode/extensions
Enter fullscreen mode Exit fullscreen mode
  1. Check for Residual Files To locate and remove any remaining VS Code files, run:
   find ~ -name '*vscode*' -exec rm -rf {} +
Enter fullscreen mode Exit fullscreen mode

For Windows

  1. Uninstall VS Code

    • Open Control Panel.
    • Navigate to Programs > Programs and Features.
    • Find Visual Studio Code in the list, right-click, and select Uninstall.
  2. Delete Configuration Files
    Open File Explorer and manually delete the following folders:

    • User data:
     %AppData%\Code
    
  • Extensions:

     %UserProfile%\.vscode
    
  • Cache files:

     %LocalAppData%\Programs\Microsoft VS Code
     %LocalAppData%\Code
    
  1. Remove Registry Entries (Optional)

    • Press Win + R, type regedit, and press Enter.
    • Navigate to:
     HKEY_CURRENT_USER\Software\Microsoft\VSCode
    
  • Right-click the VSCode entry and delete it.
  1. Restart Your PC Restart your computer to ensure all processes and files are completely removed.

Verify Full Removal

After following the steps for your operating system, you can verify that VS Code has been completely removed by searching for any residual files:

  • On macOS/Linux:
  find / -name '*code*' 2>/dev/null
Enter fullscreen mode Exit fullscreen mode
  • On Windows: Use File Explorer’s search feature to look for vscode.

If any remaining files are found, manually delete them.


Conclusion

By following this guide, you can completely remove Visual Studio Code and all associated files from your system. This ensures a clean slate if you plan to reinstall VS Code or switch to a different editor. If you encounter any issues during this process, feel free to ask for help!

Top comments (0)