I do mostly compile my scientific tools from source. That gives me an option to compile them with the latest libraries that they are depended on. Most of the source codes are very well maintained and uses great tools like Autotools etc. Of course when you choose to maintain a personal PC like that, you end up with a lot of compiling. My problem was that when I install a successfully compiled code I cannot remove it most of the time or in another words “uninstall” them. One solution is to create Debian packages, or I can install and remove when ever I want with apt tools. BUT, this needs a lot of knowledge on package management. I do not want to spend my time on learning that, I just want a solution that I can remove and compiled code I want whenever I want. Yet, I did not know that there was already a solution for such need. Here is 3 easy steps to do that:
Thanks to this website , I have learnt how to use CheckInstall. CheckInstall actually does not create a distribution quality Debian packages but does the work I want for my 3 Ubuntu computers. I do compile on my desktop and move the DEB file to the others and install in seconds, instead of compiling once again. Moreover, as I wanted I can remove anytime I want the self maintained packages.
You know in most of the compiling steps you do:
$ sudo make install
With Checkinstall the life is not that different but with some additions which are written in bold.
Step 1: Use auto-apt (you need to install it if you do not have it) instead of just “./configure”. So, do this
$ auto-apt run ./configure
Step 2: use make as you use to
Step 3: Install via CheckInstall while also creating a DEB package for the code.
$ sudo checkinstall make install
When you enter the command above, you will be asked some detail information about email address of the maintainer, description of the package etc. Like below:
**** Debian package creation selected ***
This package will be built according to these values:
0 - Maintainer: [ email@example.com ]
1 - Summary: [ GDAL/OGR by Ferhat Bingol ]
2 - Name: [ gdal ]
3 - Version: [ 1.10.0 ]
4 - Release: [ 1 ]
5 - License: [ GPL ]
6 - Group: [ checkinstall ]
7 - Architecture: [ amd64 ]
8 - Source location: [ gdal-1.10.0 ]
9 - Alternate source location: [ ]
10 - Requires: [ ]
11 - Provides: [ gdal ]
12 - Conflicts: [ ]
13 - Replaces: [ ]
When you want to check something, just enter the number of the item. When you are done, just press enter and you will see that the rest is automatic. You can see the new package in Synaptic Package Manager and remove it anytime you want.
Here is a very useful tip. Let’s say there is a software in Ubuntu stable rep and you want to install it but this software is atteched to an older version of a library you use and if you say use the old one, it will over write your new home-compiled version. Let me explain with a more detailed example.
Let’s say I want “mapserver 6.2.1″ on my desktop. If you check the Ubuntu precise rep you will see that it is attached to two libraries “libgdal1″ which is 1.9.2 version of GDAL library and “libmapserver”. Now, even you compiled and install your own libgdal mapserver installation will go an pick the old one and replace with yours. And if you re-install your compiled version of libgdal on top of it, there will be mixed code around in /usr/lib /usr/local/lib etc. It will be a mess. you can use CheckInstall to get out of this mess. So, if you replace some info from the deb-pak configuration step above as:
2 - Name: [ gdal ] => libgdal1
11 - Provides: [ gdal ] => libgdal1
13 - Replaces: [ ] => libgdal1
As you will see the new 1.10.0 will took over 1.9.2 libgdal1 library and everything will be smooth afterwards.