This is a known issue with versions prior to 10.7: Error while installing GEANT4 in ubuntu 22.04.2 LTS - #8 by bmorgan.
The Bugzilla in that link provides the report and one suggested patch, but please note that 10.6 is no longer being patched and we strongly encourage updates to newer versions (for which we can help with).