Ubuntu – I installed a program by getting its source code, and then running `sudo make install`; how to make `apt-get` know about it


I installed program (call it, for example,progA) by building it from source code, and then finally calling sudo make install and sudo ldconfig.

However, it seems apt-get hasn't gotten the memo, because when installing progB, which depends on progA, apt-get recommends I also install progA. Why is this, and what could I do?

Best Answer

TL;DR checkinstall is your friend ;)

sudo apt-get install checkinstall

After a installation with sudo make install your package manager knows absolutely nothing about this installation. But it knows all about a package with the same name in the Ubuntu repositories or in a PPA.

Use sudo checkinstall instead of sudo make install and use a higher version as the version in the repository to be sure, that your package manager accepts this version as correct dependency for ProgB.

Further information:

checkinstall is really nifty, since it follows what the make install command would do, in order to figure out how to build a package.

This means that if you install a program using make install, but then want to repent for your sins, all you have to do is sudo checkinstall -D make install, and that command will:

  1. follow make install to figure out what it does

  2. copy-cat make install, except in *.deb package form

  3. install from the package (exactly as make install would have, given point 1)) except also let apt-get know about it, and thus overwrite all the files exactly where make install would have put them as long as you choose YES to include the files put by make install in the home directory in the package as well -- a couple of options during the checkinstall process will let you choose (obviously though, the choice is there so you can exercise it on a case-to-case basis)

Bonus: you can also remove a package (call it progA again) installed using make install that odes not have make uninstall support by following the checkinstall process outlined so far, and then simply doing:

dpkg -r progA