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
  • 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 14.04

2 thoughts on “How to use checkinstall instead of make install”

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s