Creating packages from source with checkinstall

Checkinstall creates a Debian, RPM, or Slackware package from source code and installs it using your distribution’s standard package management utilities. While distribution-specific packages from trustworthy repositories are to be preferred, checkinstall allows you to make your own packages when pre-made ones are unavailable.

Use your distribution’s package manager to install. TODO: Kernel headers are a dependency; is a reboot after installing them needed?

Use your package manager to locate where the configuration file checkinstallrc was placed. Depending upon your distribution and architecture, you might find it in /etc/checkinstallrc, /usr/lib[64]/checkinstall/checkinstallrc, or elsewhere. As root, edit the configuration file as appropriate. A few examples:

Linux Mint Debian Edition 201204, amd64
The default settings work fine.

Mandriva 2010.2, i586
In /usr/lib/checkinstall/checkinstallrc:


OpenSUSE 42.1, x86_64
In /etc/checkinstallrc:


As user, unpack the source tarball to a temporary location such as ~/tmp/.

Enter the source directory, create a directory named doc-pak, and copy into it the files you want the package to install as documentation. Good candidates to be there are README, INSTALL, COPYING, Changelog, TODO, CREDITS, and so forth.

Read any installation instructions, which are usually found in INSTALL. Typically such instructions are to do, beginning as user and finishing as root, something similar to:

$ cd /path/to/unpacked_tarball
$ ./configure
$ make
$ su
# make install

Follow the installation instructions up to but not including make install. During the configure and make, correct any errors that appear and take note of any unmet dependencies you have to add; you should document them in the package when you create it.

Now, as root, checkinstall instead of make install. Should the instructions call for an unusual install command (e.g. make setup instead of make install) then give checkinstall that command as an argument (e.g. checkinstall setup).

Follow checkinstall’s on-screen instructions. When prompted for “a description for the package”, you might use the software author’s description. The “alternate source location” should be the project’s URL. For “group”, supply the most relevant of your package manager’s default groups. Should you have discovered any dependencies while doing the make above, include them in the “Requires” field.

Checkinstall will then create a package, install it, and save the package in your distribution’s location for such things. For example, packages built for i586 on Mandriva are saved to /root/rpmbuild/RPMS/i586/.

On one installation, the first use of checkinstall halted with the error message “/root/rpmbuild has no SOURCES directory. Please write the path to the RPM source directory tree”. To work around this, I created the directory /root/rpmbuild/SOURCES and answered checkinstall’s question with /root/rpmbuild.

These notes were last updated on 15 December 2016 with reference to checkinstall 1.6.2

Checkinstall README


About Warren Post

So far: Customer support guy, jungle guide, IT consultant, beach bum, entrepreneur, teacher, diplomat, over-enthusiastic cyclist. Tomorrow: who knows?
This entry was posted in Uncategorized and tagged , . Bookmark the permalink.

4 Responses to Creating packages from source with checkinstall

  1. Pingback: System monitoring with xfce4-sensors-plugin | A maze of twisty little passages

  2. Pingback: Webmake | A maze of twisty little passages

  3. Pingback: Using GradeL | A maze of twisty little passages

  4. Pingback: RPM package management tips | A maze of twisty little passages

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s