How to use checkinstall instead of make install

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.

  • Install checkinstall: First, we have to install this application:
$ sudo apt install checkinstall
  • Creating a package file: Turning the above make install into the installation of a package is as easy as:
$ 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.

  • Package name: Note that the directory name from where you are running this becomes the default package name. If you do not want that, specify a package name:
$ sudo checkinstall --pkgname foobar_by_joe
  • Make options: Checkinstall runs make install by default. If you want other options to be used, that can be accommodated too.

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
  • Install your package: I can now use the .deb file created by checkinstall to install on other computers or pass it to other people on the team:
$ sudo gdebi foo_amd64.deb
  • Uninstalling is as easy as:
$ sudo apt remove foo

Tried with: CheckInstall 1.6.2 and Ubuntu 16.04

5 thoughts on “How to use checkinstall instead of make install

  1. I have a problem. The instructions for the compilation of the package (telegram-cli) don’t include the step make install. It simply ends with make. How can I create my package for this telegram-cli? Thanks.


    1. Schus: Are you sure there is no make install? Tried it? If no, then I have no idea how to create a package for this program.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.