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 installinto 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
.debfile 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