Creating a fake debian package with checkinstall and the force-overwrite command

Definition: What is checkinstall?

Checkinstall is a tool which creates so called uncomplicated Debian packages. These are not real Debian packages as they will hold no information of the actual dependencies needed by a program which is being build as a package. So in other words: Checkinstall  packages are the ones which cannot (or more correctly: should not) be distributed as they will most likely not work outside of the host system.

The advantage given by checkinstall is that it creates a Debian package which can be later reinstalled or removed easily via package manager inside the same system. The checkinstall Debian package shows up also as system wide package so you will be able to find it more easily.  Also other programs in your system may find checkinstalled program more easily if they need to access it for some reason.

Compiling the package:

Usually compiling the package is very simple and goes like this:



After the compilation is done it is time to create our  fake Debian package with the following command (do as a root or a sudo user):


Next you will be asked a series of questions. Answer them as checkinstall proposes.

However when you are in the part: This package will be built according to these values make sure that the section 2 – Name has a value you can remember. Also take a special care of the section 3 – Version which should be a very high one since your system override your custom compiled program during the upgrades if the version value is too low.

See an example below.

2 –  Name:    [ someprogram ]
3 –  Version: [ 26:29.2 ]

You can customize all the values to fit your needs. After you are done tweaking values hit enter and wait for the package to be build. If any errors do come up when building the package retry building.

If you must override package x in order to install your custom checkinstall package type as a root or a sudo inside a terminal

dpkg -i – -force-overwrite someprogram.deb

There should be no space between – –

However use the force-overwrite command with extreme caution as it might destroy important files from your system or render your system to a broken state.