Can I update MRtrix but retain access to old commands?

Hello,

I would like to update my MRtrix to the newest version, but I still have unfinished projects in which I used the older version of mrtrix exclusively. Is it possible to somehow update my MRtrix and still have access to the older version? If so, how would you suggest I do this? Thanks.

Best,
Joe

Yes, you certainly can. See if this post helps – I think everything in there still applies, although you’ll need to amend to suit your setup…

1 Like

Hi Joe,

In addition to the post @jdtournier referenced, it may be worth also looking into using anaconda environments. It depends on what version you want to become your default.

If you want to keep your current install as the default (for now), you can install MRtrix 3.0.0 in a new conda environment like this:

$ conda create -n mrtrix3 -c MRtrix3 mrtrix3

(-n mrtrix3 sets the environment name; -c MRtrix3 is the channel; the last mrtrix3 is the package name to be installed.)
To use the new release, you then need to activate the environment:

$ conda activate mrtrix3
(mrtrix3) $ mrinfo --version
== mrinfo 3.0.0 ==
...

This version then stays active until the end of the session (e.g., until you close the terminal); conda deactivate will also revert to your current installed version.

If you want to make the new release the default, you will have to manage your path manually using the instructions @jdtournier referenced. In short, you should do a fresh install of the new release and redirect your PATH to this new install. Then, you can make an alias to activate the legacy version in your .bashrc file:

alias mrtrix3old="export PATH=/path/to/old/mrtrix:$PATH"
1 Like

Thank you both for the responses. I think I managed to get both versions running now :slightly_smiling_face:

-Joe