Install Geant4 prerequisites:
sudo apt install libboost-all-dev libmpfr4 libmpfr-dev liblzma-dev libsqlite3-dev
Get GEANT4 (via repository):
sudo sh -c 'echo "deb http://lcg-heppkg.web.cern.ch/lcg-heppkg/debian stable hep" >> /etc/apt/sources.list.d/geant4.list'
sudo sh -c 'echo "deb-src http://lcg-heppkg.web.cern.ch/lcg-heppkg/debian stable hep" >> /etc/apt/sources.list.d/geant4.list'
sudo apt update && sudo apt install cern-archive-keyring
sudo apt update && sudo apt install geant4
Setup environment:
cd
echo "export G4ENV_VERBOSITY=silent" >> .bashrc
echo "source /usr/share/geant4/env.sh" >> .bashrc
echo "export LD_LIBRARY_PATH=/usr/lib:/usr/lib64:\$LD_LIBRARY_PATH:/usr/local/lib" >> .bashrc
echo "export PATH=/usr/local/bin:\$PATH" >> .bashrc
source .bashrc