Alvaro M, Programming, Technology

Checkinstall to Create Deb Packages from Source

I really like my Ubuntu 12.04. I don’t use the Unity shell, but the system underneath is stable enough and I have plenty of packages.
From time to time however, I need to install some binary or library that it is not available as package. So I download the source compile and I am ready to install it. The problem is that I want to be able to easily uninstall the package, as easy as I install it!
That’s when checkinstall comes into place. It’s not a new project but a handy one. You can install it in your Debian or Ubuntu distribution and it allows you to intercept the “make install” command and create the Debian package you need. For example, you can do stuff like:

./configure
make
sudo checkinstall make install

You answer few questions about the package description (so later on you will remember what was it for) and then checkinstall will create the package and install it for you. Note that I tried it on Ubuntu, but it will work on any Debian, RPM or Slackware based distribution. You can now delete the original source and later on you will be able to remove the package just by typing:

apt-get remove <package>

Sweet!