TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
how about rm -rf /usr/local/texlive/2012 and rm -rf ~/.texlive2012? – cmhughes Jan 26 '13 at 20:00
For new versions, not from the official repository, consider installing on /opt. – Sigur Jan 26 '13 at 20:04
up vote 53 down vote accepted

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

  1. sudo apt-get purge texlive*
  2. rm -rf /usr/local/texlive/2012 and rm -rf ~/.texlive2012
  3. rm -rf /usr/local/share/texmf
  4. rm -rf /var/lib/texmf
  5. rm -rf /etc/texmf
  6. sudo apt-get remove tex-common --purge
  7. rm -rf ~/.texlive

    The next step is long, but not difficult.

    To remove TeX/LaTeX files from /usr/local/bin:
    cd /usr/local/bin

    Prepare a listing of files in modification time order:
    ls -ltrh >/tmp/rmlist

    Inspect the output of /tmp/rmlist. All of the files of interest will [probably] have the same modification time. The TeX/LaTeX entry for the arev file has the modification time of interest. Find the first and last files with the modification time near the arev entry.

    Create list of files to be removed:
    ls -trh >/tmp/rmcmd # creates the same list as above, but with only the file names.

    cd /tmp

    Make /tmp/rmcmd executable:
    chmod 0700 rmcmd

    Edit /tmp/rmcmd; remove all files that don't have the modification time near arev's in rmlist.

    Insert the 'rm' command at the first of each line:
    vim rmcmd
    %s/^/ rm -rv /

    Save this removal script.

    Move the removal script to /usr/local/bin:
    sudo mv -v rmcmd /usr/local/bin

    Change to the target directory:
    cd /usr/local/bin

    Run the removal script:
    Watch in gratified amazement as the files go into the bit bucket.

    Wipe your fingerprints from the keyboard.
    sudo rm rmcmd

    cd /tmp
    rm -v rmlist

I found it instructive to first look whether there's something in the files to be deleted by 'rm -rf /xx/yy/.... 'rm -rf ' doesn't tell you if it actually had to remove.

share|improve this answer
Thanks to uzsolt and kudos to @cmhughes. – mcbetz Jan 26 '13 at 22:18
Thanks to @dustin for the update for Tex Live 2013. – mcbetz Jun 21 '13 at 8:45
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
So, I have just gone through the process, took me about 20+min, just others can do it, when they've got the time to do so. Since I ran sudo apt-get remove texlive-full before some of the commands did nothing, e.g. ls -ltrh >/tmp/rmlist. Hopefully everything ready for fresh install. – quapka Oct 30 '14 at 8:26
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

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?

share|improve this answer
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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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