License Manager Error -9 when run as administrator but not normally

33 ビュー (過去 30 日間)
Paul Hellemn
Paul Hellemn 2016 年 9 月 27 日
コメント済み: Yoana Grudeva 2023 年 12 月 12 日
I have Ubuntu 16.04 and have a student version of Matlab and want to install a trial version of the Statistics and Machine Learning Toolbox. But the installer doesn't have permission (Access Denied: Unable to write to /usr/local/MATLAB/R2016b. Please select a different folder).
So I try to run Matlab with root permission using
sudo matlab &
but I get
License checkout failed.
License Manager Error -9
Your username does not match the username in the license file.
To run MATLAB on this computer, you must run the Activation client to reactivate your license.
Troubleshoot this issue by visiting:
http://www.mathworks.com/support/lme/R2016b/9
Diagnostic Information:
Feature: MATLAB
License path: /home/pjhellemn/.matlab/R2016b_licenses:/usr/local/MATLAB/R2016b/licenses/license.dat:/usr/local/MAT
LAB/R2016b/licenses/license_pjhellemn-Lenovo-ideapad-Y700-14ISK_3284817_R2016b.lic
Licensing error: -9,57.
How do I allow Matlab to be run with root permissions, so that I can install the toolbox?
  3 件のコメント
Walter Roberson
Walter Roberson 2017 年 9 月 12 日
If you are using OS-X or Linux, the username you tell MATLAB should be the same as what you get for the result of
whoami
when you run that at your shell prompt.
Maximilian Prilmueller
Maximilian Prilmueller 2023 年 10 月 19 日
I ended up here because i am currently troubleshooting the gui not starting. This Forum gave me the tip to run matlab as administrator. Now I know that the license check seems to be the only thing about my matlab that is currently working.

サインインしてコメントする。

採用された回答

Walter Roberson
Walter Roberson 2016 年 9 月 27 日
Correct. When you sudo, your username becomes root, which is not what is in the license file.
To install toolboxes on Linux you should run the installer, which you would do while sudo'd
(OS-X has the same issue about sudo and username, but when you use the Add-on explorer or the installer on OS-X, the process will ask you to authenticate and then will proceed to allow you to install.)
  2 件のコメント
Paul Hellemn
Paul Hellemn 2016 年 9 月 27 日
To add to this:
I had to first sign up for the trial version through the Mathworks website (the prompt in the Matlab application did not work), then download the Matlab installer again, and then follow the directions above.
Miguel Perez Sanchis
Miguel Perez Sanchis 2017 年 11 月 15 日
This answer might be useful to those of us who ran into this problem and managed to solve it by installing Matlab with our username instead of root. All toolboxes installed afterwards should be installed through the Matlab installer as Walter said. The installer CAN be run as sudo, unlike Matlab

サインインしてコメントする。

その他の回答 (1 件)

Ryan Patterson
Ryan Patterson 2019 年 12 月 15 日
編集済み: Ryan Patterson 2019 年 12 月 15 日
I figured it out.
In terminal go to where your activation file is located(This Might Be Different For You!) and run it. Not sure if you need "sudo" for this step.
$ cd /usr/local/MATLAB/R2019b/bin
$ sudo ./activate_matlab.sh
When asked for a name, input "root" and complete the other boxes like normal. Exit matlab. Using "sudo -i" puts it in root mode so you have permission to install it.
$ sudo -i
# cd /usr/local/MATLAB/R2019b/bin
# ./matlab
Now you should be able to install the update. After its installed you should change the activation name back to what it was originally or else you will always have to run it under "root".
# exit
$ sudo ./activate_matlab.sh
  10 件のコメント
MONRUETHAI SUEKSAKAN
MONRUETHAI SUEKSAKAN 2022 年 12 月 19 日
it's work.. thanks so much
Yoana Grudeva
Yoana Grudeva 2023 年 12 月 12 日
Thanks! For anybody having issues running the add-on explorer, it's because sometimes graphical apps are not allowed as root. To fix this, in a terminal run
xhost si:localuser:root
sudo matlab
and change back your permissions after you're done with installations by
xhost -si:localuser:root
This is a general fix for this problem, stackoverflow answer here .

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeIntroduction to Installation and Licensing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by