https://help.ubuntu.com/community/CheckInstall

CheckInstall is a make wrapper that keeps track of all files installed by a “make install” or equivalent, creates a (Slackware, RPM Distro (Red Hat Package Manager), or Debian) package with those files, and adds it to the installed packages database, allowing for easy package removal or distribution

Installation

sudo apt-get update && sudo apt-get install checkinstall

Usage

Instead of

sudo make install

you will use

sudo checkinstall

When called with no arguments, checkinstall will call “make install”. If you need other arguments, they can be supplied:

sudo checkinstall make install_package

removing installed package

sudo dpkg -r package-name

Use CheckInstall with auto-apt

You can use auto-apt when you want to build a simple package from source with checkinstall. You need to have auto-apt installed!

Instead of

./configure

you use:

auto-apt run ./configure

If the dependencies are available, a dialog box opens and ask you to install them.

The rest remains the same

make
sudo checkinstall