2

I'm unable to uninstall MATLAB;

sandeep@sandeep-VPCEH28FN:~$ sudo rm /var/tmp/lm_TMW*
[sudo] password for sandeep: 
rm: cannot remove '/var/tmp/lm_TMW*': No such file or directory
sandeep@sandeep-VPCEH28FN:~$ sudo apt-get purge matlab
E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
sandeep@sandeep-VPCEH28FN:~$ sudo apt-get purge matlab-support
E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
sandeep@sandeep-VPCEH28FN:~$
dadexix86
  • 6,616
S. Kumar
  • 17
  • 1
  • 5

1 Answers1

2

You cannot remove Matlab through an apt-get operation, just as you did not install it through an apt-get operation. You need to uninstall it manually.

If you followed the official instructions to installing it, then you are the owner, as you can see in the image below (Owner tab):

enter image description here

In consequence, you just need to delete that folder (in your case, 2016a). If you are not the owner, then you need to remove using sudo, as it follows:

sudo rm -rf /usr/local/MATLAB/

You also have a configuration file in your home folder (~/), under the name of ./matlab. If you want to delete this too (you might not do this if you are going to reinstall, for example), enable hidden files in your file explorer using Ctrl+H to be able to see it.

Finally, remove any symbolic link that might exist in the /usr/local/bin folder. In my case I just have these two but check for the 2016a version:

rm /usr/local/bin/matlab /usr/local/bin/mex

(run with sudo if you are not the owner).

EDIT: There might be other files related to your Matlab installation (as suggested here). For example, you might have some files in /var/tmp/, which you can remove too. (I do not have them, but it depends on the packages you have).

  • There are a couple of additional files that you didn't cover (see https://www.mathworks.com/matlabcentral/answers/102428-how-do-i-uninstall-matlab-products-on-a-unix-or-linux-machine) but your answer is largely spot-on. – edwinksl Aug 18 '16 at 15:00
  • Thanks. Strangely, I do not have those! :o Should I? panic panic... –  Aug 18 '16 at 15:13
  • Nah, those files you didn't cover depend on the toolboxes being installed, so not everyone will have them. :P – edwinksl Aug 18 '16 at 15:15
  • Mmm, that post seems to be very generic. I think I have the generic toolboxes. Anyway, I will update the answer. –  Aug 18 '16 at 15:16
  • Also, MATLAB for some reason puts the crash dumps in ~ itself, so that's also something you can mention if you want. – edwinksl Aug 18 '16 at 15:18
  • Please feel free to edit. I don't have any such file! It seems I'm not such a hardcore user. –  Aug 18 '16 at 15:21