OS: Ubuntu 18.04
I wanted to install vim from source, using checkinstall. So I ran this:
$ git clone https://github.com/vim/vim.git
$ cd vim/src
Here, I edited the Makefile so vim would be installed in the $HOME directory, instead of the default location that requires sudo privileges (I do have sudo privileges, but wanted to install vim locally). I also edited some other lines, like uncommenting the Python lines, or choosing the normal size of vim; but I think those are not too relevant to this post. I then ran:
$ make
$ checkinstall
Notice that I ran checkinstall without sudo. When checkinstall was done "installing", I got the following result:
Building file list...OK
Building Debian package...OK
Installing Debian package... FAILED!
However, I can now use vim in the command line and $ vim --version returns the corresponding lines, including compiled <date-of-today>. And $ which vim returns:
/path/to/home/bin/vim
I now want to uninstall vim and just install it using apt-get, even though it will install it globally.
So, what is the right way to uninstall vim in this case?
Also, other than building a deb package, what are the steps or actions that checkinstall does but make install does not?
Edit:
When checkinstall asked "Do you want to see the log file?", I typed y and the output was something like (I don remember it exactly): dpkg error: sudo privileges are required.
Later on, trying my luck (coincidentally one of the answers to this post suggested the same), I ran:
$ make uninstall
That successfully (as far as I can tell) uninstalled vim and removed the vim files from my $HOME directory. I then ran:
$ sudo apt-get install vim-gtk3
because I wanted to install a version with xterm_clipboard enabled. Then, as requested in a comment here (I read the comment after I installed vim-gtk3), I ran some commands, and the results were:
$ type -a vim
vim is /usr/bin/vim
$ dpkg -S /usr/bin/vim
dpkg-query: no path found matching pattern /usr/bin/vim
$ type -a vim? For each path in the output, what's the output of$ dpkg -S <path>? Try to reinstall with checkinstall, exactly like you did initially; when the failure occur, the script should ask you whether you want to view a log file (Do you want to see the log file?); answer yes (pressy): what does the log file tell you? – user938271 Jul 05 '19 at 16:09$ make uninstallwhich must have removed most if not all the installed files. The benefit of checkinstall is that it generates a .deb package, which can be handled by dpkg and apt-get, like any package installed from your default repositories. – user938271 Jul 05 '19 at 17:25$ apt-get purge <package>), even if$ make uninstallis not available or omits some files. Besides, when you install packages in the future, one of them may overwrite some files installed by$ make install; if that happens, your program may get broken. This is less likely to happen if the program has been installed via a .deb package. It also gives you the ability to reinstall your program on a different machine without recompiling, provided that it shares the same architecture. – user938271 Jul 05 '19 at 17:25$ sudo checkinstall --pkgname vim --pkgversion 9:8.1.1635 --spec /dev/null --backup=no -y. – user938271 Jul 05 '19 at 17:25