11

I ran the following commands to remove vim.

sudo apt-get remove vim
sudo apt-get purge vim

enter image description here

The package manager shows it doesn't exist. But when I type in vim and hit enter, it opens vim. enter image description here

When I type in :echo $VIMRUNTIME, it outputs /usr/share/vim but this folder doesn't exist. enter image description here

I tried installing vim but it still refers to this preexisting install (I'm looking for python support and this version doesn't support it).

I've exhausted all the options and unsure of what to try next.

I recently upgraded from Ubuntu 16 to 18.

5
  • 1
    What's the output of whereis vim?
    – FelixJN
    Oct 4, 2018 at 11:39
  • 1
    apt/apt-get/dpkg tools refer to packages, but programs can be installed from source, via snap, via flatpak... and other methods that apt/dpkg tools won't know about. The command provided by Fiximan should hopefully provide a clue as to where it is, and what method was used to install 'vim' (or vims - ie. you can have multiple versions of a program loaded using different methods)
    – guiverc
    Oct 4, 2018 at 11:49
  • @Fiximan The output of whereis vim was giving me /usr/share/man/man1/vim.1 location too. So I manually removed it and ran sudo apt-get install vim. Now all's good. Can you add your reply as answer and I'll accept it.
    – nick-s
    Oct 4, 2018 at 12:07
  • 1
    /usr/share/man/man1/vim.1 is only where the manual entry is saved. Not the executable programme.
    – FelixJN
    Oct 4, 2018 at 12:14
  • 2
    Please don't post screenshots of text. Copy the text here and use code formatting instead.
    – muru
    Oct 5, 2018 at 1:23

4 Answers 4

23

You uninstalled vim not vim. vim-tiny, vim-nox, vim-gtk, and vim-athena all provide vim compiled with different options.

3
  • What is strange is that he doesn't have /usr/share/vim , afaict all the vim variants in Ubuntu depend on vim-common which has files in /usr/share/vim Oct 5, 2018 at 14:55
  • @rexkogitans: /usr/bin/vim is usually managed by update-alternatives and doesn’t belong to any package. It would be more helpful to look at update-alternatives --display vim and go from there. Oct 5, 2018 at 16:03
  • @DavidFoerster Actually I ran a command to remove all of those (I don't remember which ones I installed) but for the sake of the question, I chose to stick with just vim instead of all the variants. The accepted answer helped me find where the executable was, and so I manually removed it.
    – nick-s
    Oct 16, 2018 at 7:50
13

To find the location of a program, use the whereis command

whereis vim

It should show you if and where it is installed.

Please also note: $VIMRUNTIME is only a directory holding mainly configuration files. Have a closer look here.

4

Based on answers by hildred/Fiximan, I used the following command and it worked:

sudo  apt-get purge --auto-remove vim-gtk3

I am using Ubuntu 20.04 LTS.

1

Your vim can also be a symlink to the part of neovim package, which is sometimes hard to find, because its "vim" part is in the end. After removing neovim (sudo apt-get remove neovim), you'll have probably no other vims in your system. Then you can normally instal vim via sudo apt-get install vim.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .