How to do MATLAB update, when root owns the install, but isn't the licensed user?

On my personal linux machine, matlab is installed in /usr/local/bin because I'm keeping it separate from /home where backups are frequent.
How to do an update from within matlab? If I run update from a standard matlab session, I do not have permission to write to the install. If I try running as root (e.g. sudo matlab) I'm not the licensed user. Clearly I managed to do the install; what am I missing?

 Réponse acceptée

I have Ubuntu 24.04, and for R2025b used the approach in this Edit. . After that, I just run the update installer.
It may be necessary to create the necessary paths first (the installer will indicate the paths it needs), then run the installer again with the paths created. That's worked for me in the past.
I'm relatively new to Ubuntu (the only Linux distro I have ever used), and am gradually gaining experience using it with MATLAB installations and updates.
With the procedure I described in that post, I've had no problems with MATLAB installations or updates.

6 commentaires

And where are you getting the update installer from?
There are two options, first clicking on the notification bell in the upper right corner, if it has (or recently had) a red dot associated with it. That should launch the updater.
The second is to launch the installer (that should already exist on your system, especially if you already installed an earlier update). I just looked this up to be sure, and found MathWorksUpdateInstaller and R2025a in Linux since that changed recently. You will need to close MATLAB first in order to update it. The update installer should do this automatically when you launch it, once you tell it to.
Thanks, that worked.
For the benefit of anyone else who stumbles across this thread, and whose install is owned by root:
  • in 25a, the installer is in ~/.MathWorks/ServiceHost/-mw_shared_installs/v2025.12.1.2/bin/glnxa64
  • if root owns the install, the installer needs to run as root
  • you need to supply the install root as the --destination argument to the installer
  • so, e.g. sudo ./MathWorksUpdateInstaller --destination=/usr/local/MATLAB/R2025a
Finally, as mentioned in the linked thread, the installer will finish by attempting to restart matlab. Which will fail, as root isn't the licensed user. This seems to have no side effects; restarting as the licensed user worked fine.
Some additional info. On my system with Matlab R2025bR2 and Pop!_OS 24.04, I ran into the problem that I could not use Terminal to ls the contents of -mw_shared_installs because the dash made bash think it was a flag rather than a name. I had to use the GUI to look at the contents of the folder, which in my case was v2026.2.0.3. Then I ran into the "Authorization required, but no authorization protocol specified" error. I was able to fix this by using the Terminal command "xhost +SI:localuser:root". I was then able to perform the update with "sudo ~/.MathWorks/ServiceHost/-mw_shared_installs/v2026.2.0.3/bin/glnxa64/MathWorksUpdateInstaller --destination=/usr/local/MATLAB/R2025b". As noted, the installer then crashed at the end, but I was able to start Matlab in the usual manner and it had been updated to release 4. This whole procedure is ridiculously complicated. Is Mathworks TRYING to push everyone into using Python instead?
:~/.MathWorks/ServiceHost$ ls -- '-mw_shared_installs'
v2026.2.0.3
:~/.MathWorks/ServiceHost$ cd -- '-mw_shared_installs'
~/.MathWorks/ServiceHost/-mw_shared_installs$

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

Produits

Version

R2025a

Community Treasure Hunt

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

Start Hunting!

Translated by