7

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.

  • 1
    What's the output of whereis vim? – Fiximan Oct 4 '18 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 '18 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 '18 at 12:07
  • 1
    /usr/share/man/man1/vim.1 is only where the manual entry is saved. Not the executable programme. – Fiximan Oct 4 '18 at 12:14
  • 2
    Please don't post screenshots of text. Copy the text here and use code formatting instead. – muru Oct 5 '18 at 1:23
10

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.

19

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

  • 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 – Peter Green Oct 5 '18 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. – David Foerster Oct 5 '18 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 '18 at 7:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.