Currently, I have ROOT 6.10.04 installed on my system. As my analysis code strictly requires this version of ROOT, I can not remove it.
Now, I want to install ROOT 6.26. But I don’t know how to install it on top of the existing ROOT.
Also, if I install the new version, is there any way that I can switch between these two versions? This is required because as I mention, my analysis code requires v6.10.
For any kind of software (including ROOT, but generally speaking) you don’t want to install it as a system package unless you are 100% sure you will be using only that specific version of that particular software.
If you want to have different versions of the same software and change between them whenever you feel like, you need some kind of encapsulation of different environments where the different software versions might be. To this end, I suggest you to try out:
Docker containers
Python virtual environments (in the case of ROOT, you need to manage this via conda environments)
Find online the documentation for these two different ways of managing envirnoments. The installation instructions for ROOT are, as always, at Installing ROOT - ROOT
Get back to us if you have ROOT-specific issues when installing it in one of your environments.
Cheers,
Vincenzo
So just unpack the other version to any folder (different from the folder of the ROOT you already have) and to choose either just source the thisroot.sh file from the bin folder of the version you want. If you already added this source line to your .bashrc, remove it and then you run manually the one you want after opening a terminal.
E.g., if the ROOT you have now is in /home/me/root/, first rename it (because by default the new one will also be root), e.g. to root61004 (/home/me/root61004), then extract the new one also to your home and also rename that (e.g. root62610), and then when you open a terminal just run
source /home/me/root61004/bin/thisroot.sh
or from 62610, as needed.
Just make sure you downoad the binary for your Ubuntu.