I am trying to install GEANT4, version 11.1.1 in my ubuntu system

A similar problem was reported here:Error running example B1: qt.qpa.xcb: could not connect to display

and some resolution externally here:

These were on Ubuntu within WSL, but there are some things to try in that latter post related to checking that the X server is running.