You're most welcome dryzone.
If this experience provided some insight on how to analyze the problem then great. If encountered again any additional information would be appreciated.
However, I think (imho) that it would be more beneficial to harness an FPC installation against this kind of mishaps by installing in user space (as for instance any package manager installation from your distro will ruin your current setup) and using a forced Free Pascal configuration file (fpc.cfg) that is not located in any of the standard location it searches for (see
documentation).
The configuration file that FPC uses can be forced by using the command-line option -n to ignore loading the default configuration file (if any is in place) and the @ option to point the compiler to the forced configuration file (see also
command-line options).
To prevent having to type that each and every time something needs to be compiled that can be solved by using a link, script or shell alias.
If that sounds too complicated then FPCUp(Deluxe) can do such a setup automatically and provides a small fpc shell script that can be used to invoke the stand-alone compiler (just don't use FPCUp(Deluxe) to install to the standard system directory locations as it defeats its purpose)
2 cents