Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

How to use checkinstall instead of make install

📅 2015-Mar-11 ⬩ ✍️ Ashwin Nanjappa ⬩ 🏷️ checkinstall, uninstall ⬩ 📚 Archive

There are many situations where you need to build an application from source code and install it. The typical method to install it is:

$ sudo make install

One of the major problems with installing like this is that uninstalling is not possible. You will need to know what files were installed to what destination directories and manually remove those files!

The CheckInstall application can be used to convert such an installation into a package, which can be installed and uninstalled easily using your distribution's package tools.

$ sudo apt install checkinstall
$ sudo checkinstall

This will take you through some prompts where you provide the meta information for the package. You can choose to just press Enter through these sections. After that, a package file is created and is also installed for you. For example, a foo_amd64.deb package was created for me and it was installed.

$ sudo checkinstall --pkgname foobar_by_joe

For example, I noticed that checkinstall runs make serially, even though I have specified -j in my MAKEFLAGS. So, to explicitly tell checkinstall to build in parallel:

$ sudo checkinstall make -j install

Another example, for another project the install command was make install_foobar. To use that with checkinstall:

$ sudo checkinstall make install_foobar
$ sudo gdebi foo_amd64.deb
$ sudo apt remove foo

Tried with: CheckInstall 1.6.2 and Ubuntu 16.04