After typing code .
in WSL running Ubuntu 24.04, VS Code automatically installed itself. I am now trying to uninstall it, but cannot find it anywhere. sudo apt purge code
, sudo apt-get purge code
, sudo dpkg --purge code
, and sudo snap remove --purge code
all tell me that code was not installed. The same holds for alternative names, incl. vscode
and visual-studio-code
. When I enter code .
, VS Code opens though. It clearly is installed.
I want to keep the Windows version of VS Code, but remove its Linux installation. Do you know how I can do that?
Edit:
To clarify questions in the comments:
- I have simply entered
code .
, nothing else. Unexpectedly, that was enough to trigger an installation. This behavior might be specific to WSL. snap list
tells me that no snaps are installed. Anything installed withsudo snap install --classic
should show up there.
What you likely saw, when you typed
code .
for the first time in WSL, was the installation of the "server" shim that VSCode uses to communicate with WSL:As you can see from the output above, this is stored in a hidden (dot-prefixed)
.vscode-server
directory under your home directory.If you don't plan on using VSCode from within Ubuntu/WSL, you can simple remove it via:
Running
code
again will simply regenerate it if needed. You may need to reinstall any extensions you added to the "Remote: WSL" session.