How to install "vanilla" TeXLive on Debian or Ubuntu?

These instructions have been updated for Ubuntu 16.04 and TeX Live 2016, they will probably work on most Ubuntu/Debian distributions.

Installation

Installing "vanilla" TeX Live is not as hard as you think. Things you will need:

  • An internet connection.
  • About 4 GiB of free space (2 GiB if not installing documentation).
  • Root (sudo) powers.

Note: the instructions are meant for the terminal and for installing the "original" most up-to-date version of texlive. If you're uncomfortable with the command line and plenty of sudo instructions, you can probably still install the texlive-full package from the Software center; you will end up with the "stock" version of texlive, which usually lags a bit behind the latest distribution of texlive.

Installation of dependencies

The following packages are required for this guide: wget, perl-tk. Install them with:

sudo apt install wget perl-tk

TeX Live Installer

First the official installer needs to be downloaded with the following commands:

wget http://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz
tar -xzf install-tl-unx.tar.gz
cd install-tl-20170102

The install-tl-20170102 folder is likely to be named differently. You can probably type install-tl and then press tab to autocomplete the folder name.

Now the installation can begin, run:

sudo ./install-tl

This starts the installation process. You can change all kind of options here, most of the the default options are correct. In order to have working executables and man/info -pages after installation where (1) is recommended option in Unix/Linux, while (2) in Windows:

  1. Create the following PATHs in your manpath, infopath and PATH for finding your new installation in TeXLive 2017

      export PATH=/usr/local/texlive/2017/bin/x86_64-linux:$PATH    
      export INFOPATH=$INFOPATH:/usr/local/texlive/2017/texmf-dist/doc/info
      export MANPATH=$MANPATH:/usr/local/texlive/2017/texmf-dist/doc/man
    
  2. You can have the installer create symbolic links for you by changing the options: Use o to change the options and l to create symbolic links. The default locations are correct, so just press enter to use them. Use r to return to the installation menu.
    If for some reason you overlooked this and ran the installer, it is possible to create the symlinks retrospectively using the command: tlmgr path add. See the relevant documentation for more details.

In some cases changing the other options can, of course, be helpful. Not installing the doc and source trees will save you a lot (1.8 GiB, 50%) of disk space. This comes with the downside of having to look up documentation online, instead of locally.

If you want to reduce disk space further you can also change the installation scheme or collections, but this will result in not having certain packages installed by default. You can, however, install them later through the TeX live manager.

Press i to start installation. The full installation is likely to take a long time, say between one and three hours (even on relatively fast connections). As usual, your mileage may vary, but if fewer components are selected in your settings, the process is hastened, and the missing components can be easily installed later.

Interruptions: If, for some reason, the installation is interrupted it can probably be resumed by running the installer again. This will prompt you to continue the installation. If you want to start the installation from the beginning it's probably wise to remove the following installed elements +/- possible elements mentioned in the thread answer How to remove everything related to TeX Live for fresh install on Ubuntu?

sudo rm -rf /usr/local/texlive/2016

Failures: Such a long installation process may fail due to interruptions in communications or other reasons. In such a case, you may want to to restart the installation, but this time choose the smallest configuration that would get it going. Then, you can install all missing components with sudo tlmgr --gui.

Finalising the installation

If everything went well all TeX-related commands should work. Verify this by checking the output of which tex, which should be /usr/local/bin/tex.

Fake packages

Now TeX Live works, but it's also necessary to make Ubuntu think you've installed TeX Live. This can be done with the equivs package:

sudo apt install equivs --no-install-recommends freeglut3
mkdir -p /tmp/tl-equivs && cd /tmp/tl-equivs
equivs-control texlive-local

Note: If your /tmp is mounted wit noexec flag, the build will fail as described here. You may just use another directory instead of /tmp in this case.

Then, you'll have to edit texlive-local. For this use the file provided here corresponding to the version you are installing. For instance, for 2020 use:

wget -O texlive-local http://www.tug.org/texlive/files/debian-equivs-2020-ex.txt

More information about required edits can be found in the TeX Live Debian guide.

Now you can build the package and install it (exact name of .deb is created in first command below; you can also use tab autocompletion):

equivs-build texlive-local
sudo dpkg -i texlive-local_2020-1_all.deb
sudo apt install -f

After this installing texworks through the package maintainer won't install TeX Live again. You can check if this is indeed the case by installing TeX-related packages like texworks, texstudio, qtikz or kile.

Fonts

If you want to install all OpenType and TrueType fonts so you can use them in other programs as well, you'll have to add the TeX Live fonts to the system configuration:

sudo cp $(kpsewhich -var-value TEXMFSYSVAR)/fonts/conf/texlive-fontconfig.conf /etc/fonts/conf.d/09-texlive.conf
gedit admin:///etc/fonts/conf.d/09-texlive.conf

Remove the line containing type1 and save. Now run:

sudo fc-cache -fsv

Updating

If you have installed from a CD, DVD, or an ISO image, you should update your installation to the most recent version of all packages. To do so, run the following two commands:

sudo tlmgr update --self
sudo tlmgr update --all

From now on, you can update TeX Live through the TeX Live Manager with the GUI interface:

sudo tlmgr --gui

It might complain about missing 'Tk', this can be solved by installing perl-tk:

sudo apt install perl-tk --no-install-recommends

Launcher

You can also create a launcher for Unity:

mkdir -p ~/.local/share/applications
cat > ~/.local/share/applications/tlmgr.desktop << EOF
[Desktop Entry]
Version=1.0
Name=TeX Live Manager
Comment=Manage TeX Live packages
GenericName=Packaggedit admin://e Manager
Exec=gedit -d -S -D "TeX Live Manager" 'admin:///usr/local/bin/tlmgr --gui'
Terminal=false
Type=Application
Icon=system-software-update
EOF

You may need to logout and login again for the changes to take effect.

Note: If the $XDG_DATA_HOME variable is set, use the value of that instead of ~/.local/share/applications. It is also possible to use /usr/share/applications for a system-wide launcher.

Upgrading to the next TeX Live

To upgrade you need to download and run the installer again. Do not forget to have the installer create symbolic links.

It might also be a good idea to run the font section again. You can remove the old distribution(s) by running:

sudo rm -rf /usr/local/texlive/2014
sudo rm -rf /usr/local/texlive/2015

Uninstalling TeX Live

To remove TeX Live completely you need to undo everything you've done:

  • Remove /etc/fonts/conf.d/09-texlive.conf and update font cache.
  • Remove /usr/local/texlive.
  • Remove the package created with equivs (sudo apt purge texlive-local).
  • Please, see the thread answer How to remove everything related to TeX Live for fresh install on Ubuntu? for Linux.

References and sources

  • TeX Live Debian guide
  • TeX Live Quick install
  • Enrico Gregorio's article for TUGboat

Use the net installer script from this page on the official tug.org website to install “vanilla” TeXlive.

Tricking Ubuntu into satisfying the package dependencies is more involved and requires using the equivs package. There are basic guidelines for doing so in this post on TeXblog (an unofficial blog). (This page is a bit old and was aimed at older versions of Ubuntu.) The package list there is a bit old, but the same overall procedure should still work. I’m afraid I don’t have a list offhand of what the dummy package should contain; maybe someone else will. (You can always just create new dummy packages as need be if you try to install something it tells you you have unsatisfied texlive dependencies.)


I wrote a script that automates Silex's answer and does (optionally) a lot more. It supports Ubuntu versions 12.04 up to the current version.

Download install-tl-ubuntu and run it as

sudo ./install-tl-ubuntu

To download that script, run

wget https://github.com/scottkosty/install-tl-ubuntu/raw/master/install-tl-ubuntu && chmod +x ./install-tl-ubuntu

Below I give the list of features from the GitHub repository

  • installs TeX Live 2013
    • automatically finds the fastest repository
    • gives updated progress of the install
    • restarts automatically if install fails
  • tlmgr can then be used to keep your install up-to-date
  • notifies apt so that apt does not try to install the Ubuntu texlive-* packages as dependencies (e.g. if you do sudo apt-get install lyx)
  • links to the folder where Ubuntu installs TeX files so that when you install Ubuntu packages (e.g. FoilTeX and noweb) with LaTeX files, they will be available
  • adds TeX Live fonts to be used system-wide
  • other font-related conveniences
    • tells AppArmor to allow Evince to access the TeX Live fonts
    • can install TrueType fonts that user provides (--truetype-dir)
    • can install IvriTeX Hebrew fonts (--hebrew)
  • optionally installs additional LaTeX files for common journals that are not included in TeX Live 2013 (--more-tex)
  • works non-interactively and thus can be added to a batch install script
  • tlmgr can be run from the desktop menu (if 'gksu' package is installed)
  • install can be done from an ISO file (--iso)

For more details, see

./install-tl-ubuntu --help