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

2 Ansichten (letzte 30 Tage)
I am trying to install an Update on my Linux computer by running ./R2018a_Update_#_glnxa64.sh. 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'.

Akzeptierte Antwort

MathWorks Support Team
MathWorks Support Team am 14 Feb. 2019
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 ./R2018a_Update4_glnxa64.sh
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.

Weitere Antworten (0)

Kategorien

Mehr zu Introduction to Installation and Licensing finden Sie in Help Center und File Exchange

Tags

Noch keine Tags eingegeben.

Produkte


Version

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by