I just installed Debian 11 (KDE Plasma) under Virtual Box.
And installed Lazarus 2.2.2, FPC 3.2.2 (latest stable releases)
IDE works, I can compile my app, but when I try to rebuild the IDE, I get those errors:
Warning: linker: /usr/bin/ld: cannot find -lGL
make[2]: *** [Makefile:4667: lazarus] Error 1
make[1]: *** [Makefile:5105: idepkg] Error 2
Error: make: *** [Makefile:3793: idepkg] Error 2
lazarus.pp(167,1) Error: Error while linking