MATLAB Answers


Why is the Update installer quitting with "Update installer must be run as root"?

I am trying to install an Update on my Linux computer by running ./ But the Update installer is quitting with the following error, even though I currently am root:
Fatal error: Update installer must be run as 'root'.


No tags entered yet.




1 Answer

Answer by MathWorks Support Team on 14 Feb 2019
 Accepted Answer

This usually happens when initially logging in as non-root, then switching with "su" to root, which keeps the environment of the initially logged in user.
Either use "su -" to switch to root in order to initialize root's own environment or run the Update installer with sudo, for instance:
$ sudo ./
The cause of the issue is a combination of how the installer checks who the current user is and how Linux switches users, specifically their environment variables.
The installer compares the owner of the MATLAB installation (by default /usr/local/MATLAB/R20XXx) and the value of the $USER environment variable. Linux sets the $USER variable when calling "login", but using "su" does not update this variable, on the other hand "su -" does. Running with "sudo" has a similar effect.
For example, if you initially login with "user1", $USER is set to user1. Switching to root with "su" will keep user1's environment variables, even though the current user is now root. Switching with "su -" will update $USER to root.
Refer to the man page for su (man su) for more information about this behavior.


Sign in to comment.