Using Checkinstall when Compiling from Source

Compiling Software from Source

There are times when software you need is not in managed repositories and therefore not available through apt-get, yum, etc or perhaps you just need the latest version of something and it isn't available in the repositories yet.

In this case you'll most likely have to compile from source. The common routine is

$./configure
$ make
$ make install

The Problem

What happens when you want to uninstall the software. If the vendor doesn't provide a 'make uninstall' (cough subversion cough) you'll be digging through the makefile trying to figure out what files were put where. It can be VERY difficult, if not impossible, to remove all files if the software is complex.

Enter Checkinstall

Checkinstall is a great tool that will create a package (.deb, .rpm, etc) that can be managed by a package manager. No longer will you have to go digging through makefiles if you want to uninstall software.

Install checkinstall using apt-get

$ sudo apt-get install checkinstall

Proceed with

$ ./configure
$ make

But instead of 'make install' use

$ checkinstall make install

Checkinstall will prompt you for a few values and then proceed with the install. When everything is done, your software will be installed and a package will be created in the current directory (i.e. subversion_1.5.1-1_i386.deb).

Now to remove the software, simply use

$ sudo dpkg -r packagename

where you replace 'packagename' with whatever value you entered when prompted earlier.

Labels

 
(None)