How do I change the directory my support packages get installed in?

How do I change the directory my support packages get installed in?

 Accepted Answer

MATLAB installs all support packages to a specific root folder in a default location:
What is the default directory support packages are installed to?

Specifying a custom Support Package directory at the time of installation

MATLAB R2025a and newer
A custom support package directory can be specified at the time of installation only when installing using the MATLAB Package Manager and specifying the --support-package-destination input argument. 
For more information regarding MATLAB Package Manager and the --support-package-destination input argument, please refer to the MPM Install Documentation.
MATLAB R2024b and older
For releases R2024b and older or when installing MATLAB through a means other than the MATLAB Package Manager, a custom support package directory can only be configured once MATLAB has already been installed. This process is outlined in the following section. 

Specifying a custom Support Package directory for an existing MATLAB installation

You can change this default location to a custom directory using setSupportPackageRoot. Follow the steps below to set the support package root for your MATLAB installation to a custom location and verify the change:
1. Restart MATLAB. 
2. Enter the following command in the MATLAB Command Window:
>> matlabshared.supportpkg.setSupportPackageRoot('C:\MATLAB\CustomSupportPackageRoot');
3. Restart MATLAB and verify the change:
>> matlabshared.supportpkg.getSupportPackageRoot()
ans =
'C:\MATLAB\CustomSupportPackageRoot'
Important Notes:
(1) You must have administration privileges for the custom folder you specify.
(2) You must also have administrator privileges when running 'setSupportPackageRoot' because the command calls savepath.
(3) Changing the root folder removes previously installed support packages from the MATLAB path, but the files remain on disk. This means that existing support packages must be reinstalled into the new location. Any support packages already present in the new location become available on the MATLAB path.

More Answers (0)

Categories

Products

Community Treasure Hunt

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

Start Hunting!