This is because wayland does not allow graphical applications to run as root (so no sudo). Fedora switched to wayland by default with fedora 25.
Easy workaround:
You can install matlab on fedora 25 and newer by using xorg instead of wayland to install matlab, running matlab still works in wayland.
So you'll have to log out, and switch to Xorg to install matlab (with sudo ./install
), and then you can switch back to wayland.
For installing matlab without going to Xorg:
You used to be able to use the normal installer in silent mode (no gui), however, with newer versions of matlab (since r2017a/b) you need the .iso file which can only be obtained by your licence administrator to install matlab in silent mode.
Now the solution is to run the installer as a normal user, by just running ./install
(no sudo), and then installing to a folder that user can access and moving that folder to the desired location.
The installation can be done as follows (example uses r2017b, but just change it to your version):
Make a directory you can access, for example: mkdir ~/Downloads/R2017b
Run the install script as a normal user by running ./install
in the matlabR2017bglnxa64 directory you downloaded from the MathWorks website.
When prompted for an install location in the gui installer, select the directory we previously made in Downloads.
Make a directory where you desire the Matlab installation to end up: sudo mkdir /usr/local/MATLAB
(sudo because we can't write to /usr/local/ as a regular user)
Now move both the directory R2017b and the MathWorks directory created during installation to the MATLAB folder: sudo mv ~/Downloads/R2017b ~/Downloads/MathWorks /usr/local/MATLAB
Finally, to be able to run matlab by just typing matlab
in the command line: sudo ln -s /usr/local/MATLAB/R2017b/bin/matlab /usr/local/bin/matlab
. This makes a "link" in the /usr/local/bin folder to the matlab executable file, so that your operating system can find it when you try to run matlab.
This was tested on fedora 27, but should work on both older and newer versions of fedora.