Thursday, 22 November 2007

Creating .deb-Packages With Checkinstall

Version 1.0

Author: Falko Timme <ft [at] falkotimme [dot] com>
Last edited 02/04/2005

Checkinstall is a nice tool to create simple .deb-packages that you can use in your local network (e.g. if you have to install the same piece of software on multiple computers running Debian). It lets you compile and install software from the sources like before, but with the difference that you end up with a simple Debian package which also means that you can easily uninstall the software you just compiled by running dpkg -r!

I will demonstrate the use of checkinstall by compiling and installing the anti-virus software ClamAV on a Debian system.

This howto is meant as a practical guide; it does not cover the theoretical backgrounds. They are treated in a lot of other documents in the web.

This document comes without warranty of any kind!

 

1 Install Checkinstall

It is as easy as 1-2-3:

apt-get install checkinstall

If your system tells you that it does not know a package called checkinstall then add the following line to /etc/apt/sources.list:

deb http://www.backports.org/debian/ woody checkinstall

and run

apt-get update

Then try again to install checkinstall.

 

2 Install ClamAV

We need the ClamAV sources . We will install the software from the /tmp directory.

cd /tmp
wget http://mesh.dl.sourceforge.net/sourceforge/clamav/clamav-0.81.tar.gz
apt-get install libgmp3 libgmp3-dev
groupadd clamav
useradd -g clamav -s /bin/false -c "Clam AntiVirus" clamav
tar xvfz clamav-0.81.tar.gz
cd clamav-0.81/
./configure --sysconfdir=/etc

(Please note: ./configure --help gives a list of all configuration options available.)

make

Now comes the main difference: instead of make install we run

checkinstall -D make install

Answer the question "The package documentation directory ./doc-pak does not exist.
Should I create a default set of package docs? [y]:"
with y.

Then enter a description for your package (e.g. ClamAV 0.81). A summary of the configuration options for your .deb-package will come up:

You can change them here or just hit enter to continue. Now ClamAV will be installed plus a Debian package will be created which you can find in the installation directory /tmp/clamav-0.81 as the final checkinstall summary states:

Now you can copy clamav-0.81_0.81-1_i386.deb to other Debian computers and run

dpkg -i /path/to/clamav-0.81_0.81-1_i386.deb

to install it. If you want to remove it, just run

dpkg -r clamav-0.81

This even works on the computer you compiled ClamAV on! This is a nice way to install software from the sources and remove it if you are unsatisfied with the result.

Blogged with Flock

No comments:

My photo
London, United Kingdom
twitter.com/zhengxin

Facebook & Twitter