Root installation: Build from source

I downloaded root on my ubuntu version 22.04 using the following commands.
It took some commuting time and after final installation, when i typed root on the terminal, it opened the initial page of root.

$ git clone --branch latest-stable https://github.com/root-project/root.git root_src
$ mkdir root_build root_install && cd root_build
$ cmake -DCMAKE_INSTALL_PREFIX=../root_install ../root_src 
$ cmake --build . -- install -j4 # 
$ source ../root_install/bin/thisroot.sh 

But, when i closed the terminal, and started the root again, it was shown

Command 'root' not found, but can be installed with:
sudo snap install root-framework

Please help! I am new to the softwarr

You need to put the command:

source ../root_install/bin/thisroot.sh 

in the ˜/.profile (or equivalent) file. That way it will be excuted each time you open a new terminal.
Actually you may not give a relative path to thisroot.sh (as it is now : ../root_install) . In the .profile file you should specify the full path.

okay thanks!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.