Operations 5 min read

How to Use Checkinstall to Build RPM and DEB Packages from Source

This guide explains how to install Checkinstall on Debian‑based and Red Hat‑based Linux distributions and use it to create clean RPM or DEB packages from source code, illustrated with a step‑by‑step htop example.

MaGe Linux Operations
MaGe Linux Operations
MaGe Linux Operations
How to Use Checkinstall to Build RPM and DEB Packages from Source

Installing Checkinstall

On Debian and its derivatives, install Checkinstall with the package manager: # aptitude install checkinstall On Red Hat‑based distributions, download a pre‑built RPM (for example the CentOS 6 package) and install it:

# wget ftp://ftp.pbone.net/mirror/ftp5.gwdg.de/pub/opensuse/repositories/home:/ikoinoba/CentOS_CentOS-6/x86_64/checkinstall-1.6.2-3.el6.1.x86_64.rpm
# yum install checkinstall-1.6.2-3.el6.1.x86_64.rpm

After Checkinstall is installed, you can create a package from any install command using the following syntax: # checkinstall <install‑command> If no command is supplied, Checkinstall defaults to make install.

Creating an RPM or DEB with Checkinstall

In this example we build a package for htop , a interactive process viewer similar to top.

First download the source and extract it to /usr/local/src:

# cd /usr/local/src
# wget http://hisham.hm/htop/releases/1.0.3/htop-1.0.3.tar.gz
# tar xzf htop-1.0.3.tar.gz
# cd htop-1.0.3

Check the installation command (htop uses make install):

# ./configure
# make install

Now run Checkinstall without additional parameters; it will invoke make install and ask a few questions to generate the package:

# ./configure
# checkinstall

Answer “Y” when prompted to create default documentation, provide a short description, and press ENTER to accept defaults or modify values as needed.

Checkinstall prompt for package description
Checkinstall prompt for package description
Checkinstall prompt for package details
Checkinstall prompt for package details

Checkinstall will then automatically generate an .rpm or .deb package depending on your Linux distribution.

Example output on CentOS 7:

Checkinstall creating RPM on CentOS 7
Checkinstall creating RPM on CentOS 7

Example output on Debian 7:

Checkinstall creating DEB on Debian 7
Checkinstall creating DEB on Debian 7

For more details, see the original article at http://ask.xmodulo.com/build-rpm-deb-package-source-checkinstall.html .

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Linuxpackage managementRPMdebCheckinstall
MaGe Linux Operations
Written by

MaGe Linux Operations

Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.