Create .deb or .rpm from .tar.gz with checkinstall

Welcome to Linux Screw! If you're new here, you may want to subscribe our RSS feed.

tar logoCheckinstall is extremely useful utility to create .deb packages for Debian, Ubuntu (or .rpm packages for Fedora, RedHat, CentOs) from .tar.gz (or .tgz) source tarball after it’s compiled at your Linux box. In other words you can prepare binary package for later usage without need to compile software from sources every time you need to get it installed on certain Linux box.

Another application of checkinstall is software deinstallation that was compiled and installed from sources. As you might already noticed, not every programmer adds “uninstall” rule to Makefile and thus command “make uninstall” would fail. The nice solution is to use checkinstall to prepare binary package from sources and then install or uninstall it with dpkg command (or rpm in RedHat based distributions).

Here is the short algorithm on how to prepare .deb package from clamav source tarball:

1. Install checkinstall:
sudo aptitude -y install checkinstall (Ubuntu, Debian and related distributions)
or
sudo yum install -y checkinstall
(for rpm based distributions, please note that checkinstall usually isn’t included to standard Fedora/RedHat repositories, so you will need to link up third party repo like DAG)
or
compile checkinstall from sources

2. Get clamav sources:
wget http://mesh.dl.sourceforge.net/sourceforge/clamav/clamav-0.81.tar.gz (as an example)

3. Install libraries that might be necessary for clamav compilation:
sudo aptitude install libgmp3 libgmp3-dev
(this command is applicable for Debian and certainly will be different for Fedora or RedHat)

4. Compile clamav:
tar xvfz clamav-0.81.tar.gz
cd clamav-0.81/
./configure --sysconfdir=/etc
make

5. Run checkinstall and follow its intuitive instructions (enter package description etc.):
sudo checkinstall -D make install

6. When finished you’ll get clamav-0.81_0.81-1_i386.deb (or rpm package if you use Fedora/RedHat/CentOs) you may want to install with sudo dpkg -i clamav-0.81_0.81-1_i386.deb (or sudo rpm -i ...) or move to another PC for later installation.

 
 
» You might also be interested in the following articles:
Make linux shell scripts encrypted
Create Linux user with password
How to create custom linux ISO image?
Keep ssh session saved (Unix “screen” utility)
Share your Linux related thoughts, opinions etc. with thoughts.com



» Want to stay up to date? Subscribe to our E-MAIL or RSS feed!

4 Responses to “Create .deb or .rpm from .tar.gz with checkinstall”


  1. 1 dicky

    good

  2. 2 hemanth

    ========================= Installation results ===========================
    make: *** No rule to make target `install’. Stop.

    **** Installation failed. Aborting package creation.

    Cleaning up…OK

    Bye.

    This is what i got when i tried creating a deb file for this

    http://nsl10.csie.nctu.edu.tw/products/nctuns/download/download.php

    Please mail me if u find a solution

    mailto:hemanth.hm@gmail.com

  3. 3 hemanth

    ./configure –sysconfdir=/etc
    bash: ./configure: No such file or directory

    forgot to mention that

  4. 4 Kfir

    I’m a fresh user of linux and using Debian

    This is one of the first packegs i try to install

    I’ve tryied putting this command in the terminal as a SU:

    ‘aptitude -y install checkinstall’

    Cant find package named ‘checkinstall’ in aptitude..

    Am i doing somthing wrong?

    Thx!

Leave a Reply

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word




Friendly Sites:Who is behind Linux Screw?
Aspiring Sysadmin | GeekyBits³ | Bash Cures Cancer | TOTMS
Linux Operating System | Small Linux Deployments | My SysAd Blog
The Danesh Project | ZEPY | Linux config Wiki | Planet Sysadmin
The Sys Admin | {buhay sysad} | a non-geek's linux notes
Linux HOWTOs, Tutorials & Projects with Adam Palmer | LinuxAlt.Com
My name is Artem Nosulchik (artiomix AT gmail DOT com) and I'm Linux/Unix, Cisco systems engineer. The main idea of Linux Screw is to share relevant knowledge, skills and observations over The Web. Here you can find a lot of information related to different Linux distributions, FreeBSD, IOS as well as a other Open Source around staff. Read more ››