I installed VIM by compiling from source a while back following the instructions here. At that time, for some reason, I didn't use checkinstall, as a result I can't uninstall it using sudo apt-get remove vim.

Following the advice here, I tried to remove VIM by

cd ~/tmp
hub clone vim/vim
cd vim
make VIMRUNTIMEDIR=/usr/local/share/vim/vim80
sudo make uninstall

Note, I am using make VIMRUNTIMEDIR=/usr/local/share/vim/vim80 instead of make VIMRUNTIMEDIR=/usr/share/vim/vim80 as suggested by the other link. This is because that's where there is a vim80 directory. I have also confirmed this by looking through my command line history that I indeed used make VIMRUNTIMEDIR=/usr/local/share/vim/vim80 when installing vim at that time.

After I ran the above set of commands, it seems that vim got removed, in that I can no longer start vim by typing vim in the command line. However, when I look at the output of the command, it seems its actually trying to remove the files from the non-existent directory at /usr/local/share/vim/vim81. I have posted a snapshot of the output here but it's the same for the rest of the output

rmdir /usr/local/share/vim/vim81/doc /usr/local/share/vim/vim81/print /usr/local/share/vim/vim81/colors /usr/local/share/vim/vim81/syntax /usr/local/share/vim/vim81/indent
rmdir: failed to remove '/usr/local/share/vim/vim81/doc': No such file or directory
rmdir: failed to remove '/usr/local/share/vim/vim81/print': No such file or directory
rmdir: failed to remove '/usr/local/share/vim/vim81/colors': No such file or directory
rmdir: failed to remove '/usr/local/share/vim/vim81/syntax': No such file or directory
rmdir: failed to remove '/usr/local/share/vim/vim81/indent': No such file or directory
Makefile:2776: recipe for target 'uninstall_runtime' failed
make[1]: [uninstall_runtime] Error 1 (ignored)
rm -rf /usr/local/share/vim/vim81/ftplugin/*.vim /usr/local/share/vim/vim81/ftplugin/README.txt /usr/local/share/vim/vim81/ftplugin/logtalk.dict
rm -f /usr/local/share/vim/vim81/autoload/*.vim /usr/local/share/vim/vim81/autoload/README.txt
rm -f /usr/local/share/vim/vim81/autoload/dist/*.vim /usr/local/share/vim/vim81/autoload/xml/*.vim
rm -f /usr/local/share/vim/vim81/plugin/*.vim /usr/local/share/vim/vim81/plugin/README.txt
rmdir /usr/local/share/vim/vim81/ftplugin /usr/local/share/vim/vim81/autoload/dist /usr/local/share/vim/vim81/autoload/xml /usr/local/share/vim/vim81/autoload
rmdir: failed to remove '/usr/local/share/vim/vim81/ftplugin': No such file or directory
rmdir: failed to remove '/usr/local/share/vim/vim81/autoload/dist': No such file or directory
rmdir: failed to remove '/usr/local/share/vim/vim81/autoload/xml': No such file or directory
rmdir: failed to remove '/usr/local/share/vim/vim81/autoload': No such file or directory
Makefile:2776: recipe for target 'uninstall_runtime' failed
make[1]: [uninstall_runtime] Error 1 (ignored)
rmdir /usr/local/share/vim/vim81/plugin /usr/local/share/vim/vim81
rmdir: failed to remove '/usr/local/share/vim/vim81/plugin': No such file or directory
rmdir: failed to remove '/usr/local/share/vim/vim81': No such file or directory
Makefile:2776: recipe for target 'uninstall_runtime' failed
make[1]: [uninstall_runtime] Error 1 (ignored)
rmdir /usr/local/share/vim
rmdir: failed to remove '/usr/local/share/vim': Directory not empty
Makefile:2776: recipe for target 'uninstall_runtime' failed
make[1]: [uninstall_runtime] Error 1 (ignored)
rm -f /usr/local/bin/vim
rm -f /usr/local/bin/vimtutor
rm -f /usr/local/bin/gvimtutor
rm -f /usr/local/bin/ex /usr/local/bin/view
rm -f /usr/local/bin/gvim /usr/local/bin/gview
rm -f /usr/local/bin/rvim /usr/local/bin/rview
rm -f /usr/local/bin/rgvim /usr/local/bin/rgview
rm -f /usr/local/bin/vimdiff /usr/local/bin/gvimdiff
rm -f /usr/local/bin/evim /usr/local/bin/eview
rm -f /usr/local/bin/xxd
make[1]: Leaving directory '/home/dibya/tmp/vim/src'

When I looked at the folder in /usr/local/share/vim, I noticed that the directory vim80 is still present.

Question

Is it enough to just delete the vim80 directory? Why is make uninstall trying to remove vim from /usr/local/share/vim/vim81 instead of /usr/local/share/vim/vim80?

  • Maybe try using the commit that was likely to be the HEAD at the time you built Vim initially? – muru Jul 1 at 19:27
  • @muru.. thank you very much.. Actually I had a hunch that is what it is.. so after posting this.. I went ahead and installed the vim 8.0 version that I had and then tried to uninstall it.. It worked.. and the folder in /user/local/share/vim/vim80 was gone.. Perhaps its a bug.. that it doesn't respect the VIMRUNTIMEDIR even when specified with make. – alpha_989 Jul 1 at 22:05
  • Do you want to post the solution? I can accept it.. – alpha_989 Jul 1 at 22:06
  • 1
    Nah, it's better if you posted exactly what you did (did you still have the old sources, and how did you get them if you didn't). – muru Jul 1 at 23:10

As @muru has suggested, I will post the solution here..

The situation happened, when I was trying to debug a issue related to a plugin. It seemed to work for a colleague, but not for me. So one of the hypothesis was that it was because of the differing versions of VIM.

Because the VIM version (8.0.1430) was compiled from source, I had the exact SHA id of the VIM version written down, and I also knew the SHA ID that I wanted to install.

My colleague was running VIM version (8.1.42).

My first attempt at removing VIM, was to just get the source from GitHub, and follow the steps: https://superuser.com/questions/623040/uninstalling-vim-compiled-from-source

to uninstall VIM.

Because the command vim was no longer working, I thought that VIM had been properly installed. So I proceeded to install vim_v_8.1.0042. The vim source code from GitHub has tags associated with each release. So based on that I could figure out the SHA ide of the v_8.1.0042, and installed it.

This is when I realized the VIM80 folder is still present.. and pretty large.. and maybe indicates that VIM8.0 hasn't actually been completely removed. I also noticed that VIM8.1 was being installed in VIM81 directory. So I uninstalled VIM8.1 properly and then proceeded to install VIM8.0.1430.

This left the same direction VIM80.. which confirmed that the version number was determining what directory VIM puts in the system.

After I uninstalled VIM8.0, the VIM80 directory was gone as well as vim didn't startup the vim editor.

By this process I was able to uninstall VIM80, even though I couldn't uninstall it in the beginning.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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