recently I updated my desktop PC to Ubuntu 22.04, with the same lazarus version. I compiled my progrsm (API) and compiles ok and works ok in my Ubunutu 22.04 PC. but it doesnt work in my Ubuntu Servers (18.04,20.04). the same code I compile in Ubuntu 20.04 and works in all Ubuntu Servers Versions.
There was a change in the C library between 20.04 and 22.04 that is versioned. That means you
can not run an application compiled on Ubuntu 22.04 on a 20.04. You
must compile it there (this is true no matter if it's Pascal or C as long as it links against the C library).
Edit: see also
this thread.