# Matlab R2022a ArchLinux Installer Fix and University of Maine Activation

### **Activation**

1.  Go to the [University of Maine Information Technologies](https://umservices.umaine.edu/software/matlab/index.cgi), select "Student Access" then log in.
    
2.  Go to the [MathWorks](https://www.mathworks.com/) website and create an account using your @maine.edu email address. For School, enter "**University of Maine Orono"** for the Activation Key, enter the 25-character key found on the UMO IT website (that you already logged into and should have open.)
    
3.  You now have access to download and Manage your now activated copy of MATLAB.
    

Personally, that didn't work for me. Instead, I did this:

1.  I went to my [account page](https://www.mathworks.com/mwaccount/) and selected "Link an addition license"
    
2.  The activation key is the same one from the previous steps.
    
3.  After the success message, go back to your account page and click the download icon next to the one software entry on that page. Select "Download for Linux"
    

Moving on.

### Installation

```bash
cd ~/Downloads
mkdir matlab
unzip matlab_R2022a_glnxa64.zip -d matlab
cd matlab
chmod +x install
sudo ./install
```

at this point, you'll get an error

```bash
terminate called after throwing an instance of 'std::runtime_error'
  what():  Failed to launch web window with error: Unable to launch the MATLABWindow application. The exit code was: 127
[1]    41209 IOT instruction (core dumped)  ./install
```

### Fixing the Installer

This section was copied and pasted from [this gist](https://gist.github.com/pgrepds/7c9a7e29a8b649369951e2002a85a3d0) for my archive.

EDIT 12/11/22: This tutorial is still valid for Matlab R2022b.

I had problems installing Matlab R2022a on Arch using the official installer from Mathworks. Running the installer throws the following error:

```bash
terminate called after throwing an instance of 'std::runtime_error'
  what():  Failed to launch web window with error: Unable to launch the MATLABWindow application. The exit code was: 127
fish: Job 1, 'sudo ./install' terminated by signal SIGABRT (Abort)
```

I fixed it by running each of the following commands.

```bash
cd bin/glnxa64
ls | grep libfreetype
mkdir exclude
mv libfreetype.so.6 exclude/
mv libfreetype.so.6.16.0 exclude/
cd ../../
sudo ./install
```

Finally, do the fix commands again, but this time in the directory you installed MATLAB to. If you leave everything to default, it should be `/usr/local/MATLAB/R2022b`

```bash
cd /usr/local/MATLAB/R2022b/bin/glnxa64
sudo mkdir exclude
sudo mv libfreetype.so.6 exclude/
sudo mv libfreetype.so.6.16.0 exclude/
```

now you're done.
