OK, so, we now should assume you are using (just) the debs from source forge ?
Firstly, and quite importantly, you should not have to run as root. In fact, you should never run something like a compiler as root, ever !
So, please report what happens if you run as an ordinary user. Only.
Trying out a cli compile of just fpc code is a great idea, you mentioned you were forced to run as root ? Exactly what happens when you run as you please ?
Running and compiling under Lazarus is more complicated. Because you have installed from debs, all the lazarus content is in root space, not writable. So, the 'startlazarus' (? check name) command does some clever things and keeps its working files in a directory you can write to, $HOME/.lazarus or similar. If you start lazarus with the 'lazarus' command, non of that redirection will work, and, assuming you are running as you, things don't work. (If you are running as root, very, very bad things can happen!).
So, please tell us what happens when you do these tests as you.
Davo