Try the following commands, one after another. If you progress, respective folders may already be deleted:
sudo apt-get purge texlive*
sudo rm -rf /usr/local/texlive/*
and rm -rf ~/.texlive*
sudo rm -rf /usr/local/share/texmf
sudo rm -rf /var/lib/texmf
sudo rm -rf /etc/texmf
sudo apt-get remove tex-common --purge
rm -rf ~/.texlive
find -L /usr/local/bin/ -lname /usr/local/texlive/*/bin/* | xargs -r rm
This finds all the files in /usr/local/bin
which point to a location within /usr/local/texlive/*/bin/*
and removes them; because we’ve already deleted all of /usr/local/texlive
, these are dead links. To see which files are being deleted, replace xargs rm
with xargs -t rm
(or tee
off to a log file, or whatever).
Update
In case that - after the last command (8.) - your terminal returns something like this
rm: cannot remove '/usr/local/bin/deweb': Permission denied
rm: cannot remove '/usr/local/bin/dviconcat': Permission denied
rm: cannot remove '/usr/local/bin/pkfix-helper': Permission denied
rm: cannot remove '/usr/local/bin/ulqda': Permission denied
rm: cannot remove '/usr/local/bin/kpsereadlink': Permission denied
rm: cannot remove '/usr/local/bin/bibmradd': Permission denied
...
...
...
if you know what you're doing, you can add sudo
between the pipe and xargs rm
, so that it becomes
find -L /usr/local/bin/ -lname /usr/local/texlive/*/bin/* | sudo xargs rm
or, to be more careful and also more thorough, follow the steps of this answer, which worked for me.
Update 2
Refer to this answer to solve the issue of rm: missing operand
when running (8.)
rm -rf /usr/local/texlive/2012
andrm -rf ~/.texlive2012
?/opt
.