107

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?

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

6 Answers 6

152

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 -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.)

16
  • 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
    Commented Jun 21, 2013 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
    Commented Nov 23, 2014 at 20:16
  • 5
    @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
    Commented Oct 6, 2017 at 21:24
  • 10
    @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.
    Commented Oct 25, 2018 at 16:38
  • 1
    @eng.mrgh it's a suggested edit you can find here.
    – Kyle
    Commented May 19, 2020 at 14:17
33

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?

1
  • 8
    I added your extra line to my answer. I hope you are okay with that!
    – mcbetz
    Commented Jun 21, 2013 at 8:44
11

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.

6

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

6

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)

0

I would add to Ubuntu 22.04 LTS:

sudo rm ~/.local/bin/pdftex

sudo rm ~/.TinyTeX/bin/x86_64-linux/tlmgr

sudo rm ~/.local/bin/xetex

sudo rm ~/.local/bin/luatex

Those were needed for me when trying to install TinyTeX from scratch using the R package tinytex.

2
  • Welcome to tex.sx. Commented Nov 29, 2022 at 0:10
  • Thank you @barbarabeeton!
    – Fla28
    Commented Nov 29, 2022 at 0:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .