# Parallel installation of two versions of Mathematica on Linux

What is the proper way to install e.g. Mathematica 12 alongside existing Mathematica 11.3? This link talks about installing Mathematica but it specifically says that the executable files will be placed in /usr/local/bin thus if I install Mathematica 12 using the standard procedure, these files will be replaced.

I know I could place the Mathematica 12 executables elsewhere but that is not a neat solution, I would probably prefer renaming them such as to include the version or not even putting the links in /usr/local/bin at all. Anyway, this is solvable using a different directory and then deleting it or some other way. Is there anything else that might get overwritten and I need to take care of it?

• The installer only places symlinks in /usr/bin/local. I would simply rename these, e.g. math -> math113 before installing M12.0. After you've installed M12.0, math will start the 12.0 kernel and math113 will start the 11.3 kernel. Actually, I'd immediately make copies of the new symlinks with names such as math120. Then when 12.1 comes out, I don't even need to rename anything anymore. Naming would also be consistent: math starts the default version, math120 starts 12.0, math113 starts 11.3, etc. – Szabolcs Apr 27 '19 at 14:24

What that knowledgebase article doesn't tell you is that the installer won't blindly overwrite the symlinks in /usr/local/bin (well, not unless you set options to make it do that). So if the installer finds exisiting (symlinks to) executables in /usr/local/bin, it will ask you whether to overwrite or rename the existing links. Choose rename, and give them some sensible suffix (I use 1130). Then math and mathematica will refer to your most recently installed version, and older versions will have specific names. This is how I managed the more than 20 versions of Mathematica I have installed on my machine...

Also, the installer has a help message with brief descriptions of automation options for calling the script, which are useful if you'll be installing on a large number of machines. Do ./MathInstaller -help. (If you use the self extracting installer script rather than the CD image, it has a separate set of options for the extraction stage. Do ./installer.sh -help.)

I have installed various versions of Mathematica using the standard installer (most recently V12.0).

I can find the path to old versions of Mathematica. E.g. in bash

ls -l \$(which Mathematica)


returns

lrwxrwxrwx 1 root root 59 Apr 17 20:46 /usr/local/bin/Mathematica -> /usr/local/Wolfram/Mathematica/12.0/Executables/Mathematica


From this I was able to find earlier versions installed in parallel directories (with "12.0" replaced with the version number).

For example, I can launch V11.1 with

/usr/local/Wolfram/Mathematica/11.1/Executables/Mathematica&