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.
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.rpmAfter 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.3Check the installation command (htop uses make install):
# ./configure
# make installNow run Checkinstall without additional parameters; it will invoke make install and ask a few questions to generate the package:
# ./configure
# checkinstallAnswer “Y” when prompted to create default documentation, provide a short description, and press ENTER to accept defaults or modify values as needed.
Checkinstall will then automatically generate an .rpm or .deb package depending on your Linux distribution.
Example output on CentOS 7:
Example output on Debian 7:
For more details, see the original article at http://ask.xmodulo.com/build-rpm-deb-package-source-checkinstall.html .
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
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.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
