MATLAB Answers

How can I change the temp directory the MATLAB installer uses?

367 views (last 30 days)
I am installing MATLAB but the installer cannot run to completion because my /tmp folder is not large enough. Is there anyway I can bypass using /tmp or switch the directory?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 13 May 2020
Edited: MathWorks Support Team on 13 May 2020
The -tmpdir installer flag can be used to change the directory where temporary files are created and deleted during installation.
Warning: If you set the directory or folder without specifying a subfolder to place the temporary files, the -tmpdir installer flag will delete everything inside the directory or folder.
Windows:
Run Command Prompt
Drag the extracted setup.exe into command prompt to create the path.
At the end of the path type, "-tmpdir \path\to\tempfolder\"
As of R2018b, the downloaded archive files will also be in tmp folder. You will also need to use the -downloadFolder flag as well as the -tmpdir flag.
setup.exe -downloadFolder \path\to\download\destination -tmpdir \path\to\installation\destination
Linux and Mac:
$ ./install -tmpdir /path/to/installation/destination
Log files will still be placed into the /tmp directory and not into the directory specified in -tmpdir. As of R2018b, the downloaded archive files will also be in tmp folder. You will also need to use the -downloadFolder flag as well as the -tmpdir flag.
./install -downloadFolder /path/to/download/destination -tmpdir /path/to/installation/destination
  4 Comments
Jason Smit
Jason Smit on 3 Apr 2021
Man this needs to be documented better! Took me 3 days to recover files the installer deleted 2 years ago and I was lucky to get them back. To those who have yet to bump there head against this, make sure to specify a TEMP location that is specific to the installer because MATLAB erases the folder when done (rm -rf ./*). I now install using a newly created temp dir just for MATLAB and suggest others do the same.

Sign in to comment.

More Answers (5)

Grey Christoforo
Grey Christoforo on 29 Jan 2020
Edited: Grey Christoforo on 30 Jan 2020
These options are not even documented in the installer_input.txt or install_guide.pdf files that I expect to detail all the installer's configuration options. Why are these important parameters being kept secret?
/tmp is a ram disk on many systems[1] and by default the installer is downloading ~10+ of gigabytes into that (depenging on what toolboxes are being installed). Am I missing something? This design seems like its asking for trouble on a lot of situations. Using /var/tmp by defualt may be a good alternative.
[1]: https://en.wikipedia.org/wiki/Tmpfs
  2 Comments
Grey Christoforo
Grey Christoforo on 30 Jan 2020
That doesn't match with how I can verify that installer_input.txt operates today.
installer_input.txt seems to contain the _option_ for telling the installer to run in silent mode. Other options in that file do not need silent mode to operate properly. For example, if you put your file instiallation key into the installer_input.txt file and run the installer with it, that key gets auto populated in the installer gui and the gui installer runs as expected otherwise.

Sign in to comment.


Ho Sean
Ho Sean on 15 Apr 2020
This option (-tmpdir) not works in R2020a installer, is there something wrong? or should I disable tmpfs.mount feature in Linux system?
  3 Comments
Benjamin Herne
Benjamin Herne on 6 Aug 2020
The joys of closed-source software - change what you want, when you want, and dont tell the consumer, because theyve already paid. You are in complete control, with no checks and balances from the community.

Sign in to comment.


Ilya Shipachev
Ilya Shipachev on 4 May 2020
Your solution worked for me. The problem also that Matlab2020a is delivered as .exe installer, but not the setup.exe file. So I had to cancell the installation again after unzipping and go manually to the folder through command line.
I would mention quite popular case I have: Windows installed to the disk C. Disk size is picked around 50Gb to fit all system needs but still running out of space, even though I'm using different disk to install programs and store my files.
I didn't have 10Gb free space on disk C. So I was quite surprised that Matlab is running out of space on disk C when I've picked disk F as an installation location. Some options to pick temporary folders would be nice I think.

Nehemiah Mork
Nehemiah Mork on 28 Sep 2020
If anyone is getting a location error when trying to open matlab (version 2020b) when using the command window do this.
D:\....path...\setup.exe -downloadFolder D:\....location to download
worked for me to download but then when I would try and open Matlab it would say matlab is not where it should be and would give me a location error and would not open. What I ended up having to do is go into windows control panel and change where my temporary files were stored and change them from a C:\ drive file to a D:\ drive file so they were being saved in the same driver as where I was installing matlab so I did not get that location error. If anyone is also getting that error watch this youtube video on how to change your temporary save location from C:\ drive to D:\ drive.
  2 Comments

Sign in to comment.


Tags

No tags entered yet.

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!