MATLAB Answers

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

415 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 at 4:00
Edited: MathWorks Support Team on 13 May 2020 at 18:31
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.
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


Richard Thompson
Richard Thompson on 8 Apr 2019
I had asked this same question in my ticket a couple years ago. 02348166
My suggestion was that you add this -tempdir documentation to your help page
However it looks like that suggestion was never acted upon.
Petru-Armand Bancila
Petru-Armand Bancila on 18 Feb 2020
The installation script will wisely run "rm -rf" on the folder you choose as your temp folder:
# Clean up
if [ $DO_COPY -eq 1 ]; then
rm -rf $TEMP_DIR

Sign in to comment.

More Answers (3)

Ilya Shipachev
Ilya Shipachev on 4 May 2020 at 18:41
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.


Sign in to comment.

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.


Colin Fraser
Colin Fraser on 30 Jan 2020
The installer_input.txt is for silent installation and would assume that you already had offline installation files located in the /archives folder already. Therefore, there would be no need to go into TEMP. Your suggestion about including the temp directory information to the install_guide.pdf is a valid point. I have submitted it to our documentation team.
Colin Fraser
MathWorks Installation and Licensing Support
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?

  1 Comment

Colin Fraser
Colin Fraser on 29 Apr 2020 at 13:38
Make sure that you set the -downloadFolder flag the same as -tmpdir.
If you are still experiencing this issue, please create a service request below.
-Colin Fraser

Sign in to comment.

Sign in to answer this question.


No tags entered yet.


Translated by