2

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
evaristegd
  • 353
  • 5
  • 16
  • What's the output of `$ type -a vim`? For each path in the output, what's the output of `$ dpkg -S `? 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 (press `y`): what does the log file tell you? – user938271 Jul 05 '19 at 16:09
  • @user938271 , thanks for the interest. I edited my post replying to your questions. I read your comment a little too late, so the responses might not be exactly what you asked for, but I hope they can help. – evaristegd Jul 05 '19 at 16:41
  • I could be wrong, but I think you did fine. checkinstall was able to generate a .deb, but was not able to install it, because installing a package on your system requires sudo (even if your binary is in your home), and you did not. You've then run `$ make uninstall` which 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
  • In particular, this should give you the ability to remove all the installed files (`$ apt-get purge `), even if `$ make uninstall` is 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
  • 1
    See the wiki for more info: https://help.ubuntu.com/community/CheckInstall Using checkinstall can be quite tricky though, because you have to give it several options for it to work as expected. As an example, this is how I would install vim 8.1.1635: `$ sudo checkinstall --pkgname vim --pkgversion 9:8.1.1635 --spec /dev/null --backup=no -y`. – user938271 Jul 05 '19 at 17:25
  • @user938271 , thank you. I found your last comment particularly insightful. Would you mind writing an answer? The chances I accept it are pretty high, I would say. – evaristegd Jul 05 '19 at 22:39
  • 1
    Sure, I will if that helps. But not now, because it would take some time to write a complete answer. I'll try to do it in the next few days. – user938271 Jul 05 '19 at 23:20
  • @user938271 , I am ready to accept your answer at any time. I will wait for some more days; if even then I don't see your answer, I will have to accept the only answer there is now. – evaristegd Jul 16 '19 at 01:02

1 Answers1

1

You didn't read man checkinstall and didn't save any data from it.

To uninstall software that was installed via make, thusly:

cd vim/src
make uninstall
waltinator
  • 35,099
  • 19
  • 57
  • 93
  • Thanks for the reply. How do I "save data from it"? – evaristegd Jul 05 '19 at 16:26
  • By reading `man checkinstall` – waltinator Jul 05 '19 at 17:41
  • The tone used in this answer is not great. It's also slightly misleading because the manpage doesn't spell this out explicitly. In fact, at the time of writing, the output from checkinstall says, "You can remove it from your system anytime using: dpkg -r vim". – pdoherty926 Jan 26 '22 at 19:00