Vim is still present and executable even after running apt remove and purge on its package
Solution 1
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.
Solution 2
You uninstalled vim
not vim. vim-tiny
, vim-nox
, vim-gtk
, and vim-athena
all provide vim compiled with different options.
Solution 3
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.
Solution 4
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 vim
s in your system. Then you can normally instal vim
via sudo apt-get install vim
.
Related videos on Youtube
nick-s
Updated on September 18, 2022Comments
-
nick-s over 1 year
I ran the following commands to remove vim.
sudo apt-get remove vim sudo apt-get purge vim
The package manager shows it doesn't exist. But when I type in vim and hit enter, it opens vim.
When I type in
:echo $VIMRUNTIME
, it outputs /usr/share/vim but this folder doesn't exist.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.
-
FelixJN over 5 yearsWhat's the output of
whereis vim
? -
guiverc over 5 years
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) -
nick-s over 5 years@Fiximan The output of
whereis vim
was giving me/usr/share/man/man1/vim.1
location too. So I manually removed it and ransudo apt-get install vim
. Now all's good. Can you add your reply as answer and I'll accept it. -
FelixJN over 5 years
/usr/share/man/man1/vim.1
is only where theman
ual entry is saved. Not the executable programme. -
muru over 5 yearsPlease don't post screenshots of text. Copy the text here and use code formatting instead.
-
-
Peter Green over 5 yearsWhat 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
-
David Foerster over 5 years@rexkogitans:
/usr/bin/vim
is usually managed by update-alternatives and doesn’t belong to any package. It would be more helpful to look atupdate-alternatives --display vim
and go from there. -
nick-s over 5 years@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.