76

I installed Visual Studio Code a while ago, and I'm now trying to remove it. I don't remember how I installed it, but everything I've tried to remove it doesn't work. Things I've tried:

  1. sudo umake web visual-studio-code --remove: This says "can't remove because you don't have it installed," which I know isn't true. I was able to find the files in /home/jacob/.local/share/umake/web/visual-studio-code. Deleting those files, by the way, stops the application from running, but doesn't remove the icon from the launcher. I restored the files once I figured that out.
  2. Removing via Software Center: It does show up in Software Center, but when I hit "remove" nothing happens.

Any other suggestions?

JacobTheDev
  • 1,059
  • 2
  • 11
  • 16
  • 1
    Check on the folder, if you have a uninstall.sh file – T04435 May 13 '16 at 15:46
  • 1
    You may also want to remove /etc/apt/sources.list.d/vscode.list to drop the vscode repo. – Daniel Aug 01 '18 at 02:28
  • 3
    To uninstall vscode in debian distros: sudo apt purge code then remove the plugins by rm -rf /home/<user>/.vscode then remove all the configuration by also removing the config by rm -rf /home/<user>/.config/Code A link to the same https://code.visualstudio.com/docs/setup/uninstall – Felix Orinda Apr 11 '22 at 01:50

10 Answers10

114

I did it with the following command:

sudo apt purge code

to uninstall the program and then:

sudo apt autoremove

to remove the menu items/shortcuts etc as @Joe suggested.

I hope it helps!

Edit: You can also check @Felix's comment and remove the vscode folders:

rm -rf ~/.vscode ~/.config/Code
haralambov
  • 1,444
  • 1
  • 11
  • 12
  • 3
    Running those commands already removed the shortcut for me. After uninstalling I installed VSCode again but this time via sudo snap install code --classic - snap has more recent versions and keeps it updated automatically. – Philipp Apr 21 '20 at 08:00
  • This is the top answer but the comment by @Felix on question is what worked for me. Needed to delete those directories! – Hache_raw Jan 30 '23 at 10:41
13

As none of the above answer has been accepted so I am assuming it didn't solve your problem. If you cannot find it with apt or dpkg then most likely it was installed with snap as was in my case. To remove it just type:

snap remove code
12
sudo dpkg --remove visual-studio-code

This will remove the software (including the Dash icon/desktop entry).

I think that this method will leave the configuration information around (if you re-install); there's also a purge option on dpkg that will remove this information as well.

sudo dpkg --purge visual-studio-code
  • Thanks, but I get the following error: dpkg: warning: ignoring request to remove visual-studio-code which isn't installed. This is driving me crazy, I can see it installed -_- – JacobTheDev May 14 '16 at 02:53
  • 9
    It works for me. But only with code instead of visual-studio-code

    (code_1.14.0-1499719149_amd64.deb)

    – yucer Jul 12 '17 at 08:38
  • 1
    AFAIK on Ubuntu this is practically the same as apt solution (perhaps more low level than APT method). However, I believe this is better solution if you have installed VS code via .deb package originally (e.g. downloaded .deb from VS code web site). This shall be applicable to older Ubuntus. More recent ubuntu allow installing code using snap and removal is better done from app manager. – Lj MT May 26 '19 at 16:46
7

I had to update VS Code from the Software Center to uninstall it properly. -_-

After that, this worked perfectly:

sudo apt-get purge code
Kendra Havens
  • 71
  • 1
  • 2
4

I was running into the very same problem today. None of the provided answers solved it for me. So I tried:

$ which visual-studio-code
/home/tim/.local/share/umake/bin/visual-studio-code

I was having a look at that directory and realized it was a symlink to

/home/tim/.local/share/umake/bin/visual-studio-code -> 
/home/tim/.local/share/umake/ide/visual-studio-code/bin/code*

So I was able to remove it with

umake ide visual-studio-code --remove

(Note how I use umake ide and not umake web)

  • 1
    Never tried dev packages installation frameworks, but this is good hint if one used such method to install VScode. – Lj MT May 26 '19 at 16:49
  • 1
    This should be the correct answer. Thanks mate. Saved me a lot of time. – vohrahul Feb 19 '20 at 06:45
3

I find this command from http://tipsonubuntu.com/2017/03/03/install-ms-visual-studio-code-ubuntu-16-0416-10/ and it work for me.

sudo apt remove code && sudo apt autoremove
David Foerster
  • 36,264
  • 56
  • 94
  • 147
1

For all of them like me, code or visual-studio-code didn't work try using, vscode.

1

Classic

sudo apt purge code && sudo apt autoremove

Do not forget

rm -fr ~/.vscode (That was taking a good 500M on my machine)

1

If you have installed it with umake, chances are that you didn't use sudo in front of it, so to remove it just type in umake web visual-studio-code --remove. That's it.

boriseto
  • 66
  • 4
0

sudo apt-get purge --auto-remove code

This should remove the files (of visual-studio-code), its configuration files and the dependencies.

ankit7540
  • 4,185