How to uninstall MATLAB in Ubuntu or other Linux distros?

Most of the software has script to uninstall the whole software but in MATLAB there is no uninstaller. So, in-order to remove MATLAB, you simply need to delete the MATLAB installation by following the instruction below:

Note: If you haven’t activated the license file then, simply escape the step 1 and 2.

  1. If you are running a license manager for MATLAB, shut down the license manager using the lmdown script located in MATLAB’s directory. If this folder doesn’t exist then, remember you’re not running the FlexNet license manager.

For example:

$ /usr/local/MATLAB/R2010b/etc/lmdown
  1. You should also remove any license manager files in the /var/tmp directory. These files should begin with lm_TMW.

For example:

$ rm /var/tmp/lm_TMW*
  1. Remove the entire root MATLAB directory using the rm -rf command. The -r argument stands for recursive. It means, it will remove what you ask, as well as all the files and directories underneath it. And, the -f argument stands for force. It means, it will ignore non-existent files and never prompt.

For example:

$ rm -rf /usr/local/MATLAB/R2010b
  1. Remove any symlinks to MATLAB binaries on the path.

For example:

$ rm /usr/local/bin/matlabĀ /usr/local/bin/mcc /usr/local/bin/mex /usr/local/bin/mbuild

I hope this will work for you!

Published on Nov 1, 2017

Last revised on May 5, 2021