LinuxCommandLibrary

checkinstall

Create installable packages from source code

TLDR

Create and install a package with default settings

$ sudo checkinstall [[-y|--default]]
copy

Create a package but don't install it
$ sudo checkinstall --install=[no]
copy

Create a package without documentation
$ sudo checkinstall --nodoc
copy

Create a package and set the name
$ sudo checkinstall --pkgname [package]
copy

Create a package and specify where to save it
$ sudo checkinstall --pakdir [path/to/directory]
copy

SYNOPSIS

checkinstall [options] [-- arguments]

Typical usage:
1. Configure and build the software: ./configure && make
2. Run checkinstall: sudo checkinstall [options] (then follow prompts for the install command, e.g., make install)
3. Alternatively, specify the install command directly: sudo checkinstall [options] make install

PARAMETERS

-D, --type=debian
    Create a Debian (.deb) package. This is often the default on Debian-based systems.

-R, --type=rpm
    Create a Red Hat (.rpm) package. This is often the default on Red Hat-based systems.

-S, --type=slackware
    Create a Slackware (.tgz) package. This is often the default on Slackware systems.

--install=no
    Do not install the generated package immediately after creation. Just build the package file.

--default
    Accept all default answers without prompting the user for information (e.g., package name, version, description).

--fstrans=no
    Do not perform filesystem translation (e.g., /usr/local to /usr). Use with caution, as it can lead to non-standard package structures.

--pkgname=<name>
    Specify the name of the package. If not provided, checkinstall attempts to guess it.

--pkgversion=<version>
    Specify the version of the package.

--pkgrelease=<release>
    Specify the release number of the package (e.g., for updates).

--maintainer=<email>
    Set the email address of the package maintainer.

--nodoc
    Do not include documentation files in the generated package.

--backup=no
    Do not create backups of files that are modified or overwritten during installation.

--provides=<string>
    Add a 'Provides' entry to the package metadata, indicating capabilities or virtual packages it provides.

--requires=<string>
    Add a 'Requires' entry to the package metadata, specifying package dependencies.

DESCRIPTION

checkinstall is a program that monitors an install command (like make install) and creates a standard package (such as a .deb, .rpm, or .tgz file) from the files that would have been installed.

Instead of scattering files directly into your system directories, checkinstall bundles them into a package. This package can then be installed using your distribution's native package manager (e.g., dpkg, rpm, installpkg). This approach offers significant benefits:
1. Easy Uninstallation: The software can be cleanly removed using the package manager.
2. System Cleanliness: Avoids polluting your system with untracked files.
3. Reusability: The generated package can be installed on other compatible systems.

It's particularly useful when you need to install software not available in your distribution's repositories, or a specific version of a program, providing a cleaner alternative to a direct make install.

CAVEATS

1. Build Dependencies: checkinstall does not resolve or manage build-time dependencies. You must ensure all necessary development tools and libraries are installed before running make.
2. Complex Installations: It may not perfectly handle highly complex installation procedures that involve intricate scripting, modifications to system configuration files outside typical installation paths, or user-specific setups.
3. Not a Replacement for Proper Packaging: While convenient, it's not a substitute for creating official, robust packages using tools like debhelper or rpmbuild, especially for distribution to a wider audience.
4. Root Privileges: It must be run as root (or with sudo) because it needs to monitor system calls and write to system directories.

TYPICAL USAGE FLOW

The general workflow for using checkinstall is:
1. Download and extract the source code.
2. Navigate into the source directory.
3. Run the configuration step (e.g., ./configure).
4. Compile the software (e.g., make).
5. Execute checkinstall (e.g., sudo checkinstall), which will then prompt you for the installation command (typically make install) and package metadata. It then wraps the installation, creates the package, and optionally installs it.

OUTPUT PACKAGE LOCATION

By default, the generated package file (.deb, .rpm, or .tgz) is created in the directory where you run checkinstall. After creation, you can manually install it on other compatible systems using the appropriate package manager.

HISTORY

checkinstall was developed as a pragmatic solution for users who wanted to install software from source code but also wished to retain the benefits of a package management system, primarily for clean uninstallation. It filled a gap between the often 'dirty' make install and the more complex process of creating full-fledged native packages. Its focus has always been on ease of use and practicality for individual users and system administrators installing custom software.

SEE ALSO

make(1), dpkg(1), rpm(8), installpkg(8), apt(8), yum(8), dnf(8)

Copied to clipboard