How can I remove everything that is related to TeX Live from my Ubuntu 12.04? I first used the backport packages from ppa:texlive-backports/ppa and later the manual install via install-tl-unx.tar.gz. Somehow, everything screwed up, so I want to remove everything to start from scratch.

I want to get a recent TeX Live with Biber support and extended font support, i.e. support for Source Sans Pro.

What to do?

  • 1
    how about rm -rf /usr/local/texlive/2012 and rm -rf ~/.texlive2012? – cmhughes Jan 26 '13 at 20:00
  • 1
    For new versions, not from the official repository, consider installing on /opt. – Sigur Jan 26 '13 at 20:04

Try the following commands, one after another. If you progress, respective folders may already be deleted:

  1. sudo apt-get purge texlive*
  2. sudo rm -rf /usr/local/texlive/* and rm -rf ~/.texlive*
  3. sudo rm -rf /usr/local/share/texmf
  4. sudo rm -rf /var/lib/texmf
  5. sudo rm -rf /etc/texmf
  6. sudo apt-get remove tex-common --purge
  7. rm -rf ~/.texlive
  8. find -L /usr/local/bin/ -lname /usr/local/texlive/*/bin/* | xargs 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).


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.

| improve this answer | |
  • That is fine. Without that command, an artifact from debian installation is left over. This isn't a problem for 2012 but it cause a headache for me when installing 2013. – dustin Jun 21 '13 at 13:04
  • 7
    This is why I find it hard to like Linux. With Windows, I click one Uninstall button and I'm done. With Linux, it takes half an hour of command line typing :-/ – Nate Nov 23 '14 at 20:16
  • 6
    I don't understand why you use sudo for the apt-get commands, but not for the rm commands. Since you are deleting system directories, sudo is also required for those or am I missing something? – tc88 Jan 5 '16 at 14:57
  • 3
    @Nate Actually, that's exactly why people use Linux and blame Windows for lacking a decent terminal. ;) I do not want to bring up the old Linux-Windows war, but it's the shortcoming of "texlive" installing system, not Linux. – cartoonist Oct 6 '17 at 21:24
  • 6
    @mcbetz @thymaro Thanks for the answer and edit. However, find -L /usr/local/bin/ -lname /usr/local/texlive/*/bin/* | xargs rm yields the following error: rm: missing operand. I am not sure why this is happening? – DavidC. Oct 25 '18 at 16:38

Martin Betz's answer is great but it is missing one line that caused issue on my machine (Ubuntu 13.04). This was for upgrading from 2012 to 2013.

After 5., run sudo apt-get remove tex-common --purge. If not, you may have the problem I faced here Does TeXLive2013 need any special install instructions?

| improve this answer | |
  • 5
    I added your extra line to my answer. I hope you are okay with that! – mcbetz Jun 21 '13 at 8:44

I think you should

  1. remove all packages (via ubuntu's package manager and install-tl too)
  2. remove /usr/{,local}/share/texmf*
  3. remove texmf-releated things from /var/ (maybe /var/lib/texmf)
  4. remove /etc/texmf too
  5. your home directory: ~/.texlive

I think it's enough.

| improve this answer | |

If you installed TeX Live using install-tl: sudo tlmgr remove --all.

| improve this answer | |

For Ubuntu 18.04 LTS you can just use

sudo apt autoremove --purge texlive tex-common

This will delete configuration and/or data files of texlive and tex-common (and it's dependencies)

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.