Suppose I want to:compile and install my own custom applicationwhich requires downloading, compiling and installing the source for newest version of libthriftwhich requires downloading, compiling and installing the latest version of libboostHere, I'm installing these libraries in my system which may interact with other packages -- very many libraries depend on libthrift and libboost.installing these may break existing package installed with apt-get/yumAlso, if I later run apt-get or yum:my custom libthrift and libboost will be overwritten breaking my custom application that depends on custom versions of these libraries.So, what's the solution here? I don't want to install into /home (I'd like the packages to be available to shared users in a code regression build cluster). I've also read that /opt is not really for this purpose (the packages installed should be self-contained, which they are not). The references I've found seem to cover this case in enough detail.
How can I get self-compiled packages to play nice with packages managers (e.g. apt-get, yum)
apt;compiling;yum;deb;autoconf
Generally, the solution is don't try to install from source into directories managed by your packaging system.You can install your custom-compiled code into /usr/local, for example, and having anything that depends on it look to /usr/local for libraries and include files using appropriate invocations of your build system (e.g., setting CPPFLAGS/CFLAGS/LDFLAGS for a typical Makefile).You could even install everything into an application-specific directory (e.g., /usr/local/myapp, or /opt/myapp).This is also a great use case for something like Docker, which makes it very easy to set up isolated development/runtime environments that are isolated from your host.