Sample Header Ad - 728x90

`checkinstall` seems super dangerous (deletes /lib symlink...) - is there an alternative?

15 votes
4 answers
1266 views
_Heads up: This is *not* a question about how to recover the system (easily done), but about checkinstall. Feel free to skip the "Background" section._ # Background _A little rant plus maybe a PSA..._ My scenario is this: I configure and make some application and then run checkinstall to create a .deb package for it. If it works, I find this useful: I see my custom software in apt output; I can put the package on hold to avoid apt trying to install the same package from upstream (if there is one), I can cleanly uninstall it with apt purge mypackage and so on and forth. Also, if other packages depend on this, they will see mine, and will not try to pull in conflicting upstream packages. Unfortunately I just found out that if during the install (when checkinstall seemingly internally calls make install) something goes wrong, then checkinstall will try to restore some files from "backup" (whatever or wherever that may be?). In my case checkinstall thought it would be a good idea to replace the somewhat important /lib symlink with a directory; the content of it was just terminfo/x/xterm-256color after checkinstall was done with it. Needless to say literally every binary in a Ubuntu-based installation depends on something from /lib so the system is immediately broken.
...
make: *** [Makefile:537: lisp] Error 2
****  Installation failed. Aborting package creation.
Restoring overwritten files from backup.../usr/bin/checkinstall: line 95: /usr/bin/gettext: No such file or directory
...
(/usr/bin/gettext of course is still there but like any other binary it requires at least libc.so which is in /lib). You can't even ls or ln anymore to fix the issue right there, the system cannot even shut down anymore as basically no new process can be started whatsoever. The situation is easily remedied booting from a rescue system, the original /usr/lib is thankfully still intact; only the symlink needs to be restored. Obviously I will not be using checkinstall anymore. I have no idea how it decided that this terminfo file needed "recovery", and don't even want to imagine what else it could have destroyed. # Question Is there a safe and easy way on a Ubuntu/Debian based system to create a .deb package for some custom software in a way similar to checkinstall but without the risk of trashing the system like this? Back when I decided to use checkinstall, all alternatives I looked at seemed to involve significant manual work - basically the same as a package maintainer would have to do - which would not be worth it to me. I do not want to distribute the .deb files, just be able to track them a little and make them visible to package management. Heck; is there a standard way to just fake a package and pretend it's installed, somehow?
Asked by AnoE (947 rep)
Jun 14, 2025, 07:26 AM
Last activity: Jun 21, 2025, 06:49 AM