ZNHOO Whatever you are, be a good one!


  1. texmf
  2. Overview
  3. Installation
    1. OS Package Manager
    2. Net Installer
    3. DVD ISO
      1. Preparation
      2. Installation from ISO
      3. TeX environment variables for Unix
      4. Check Installation Scheme
  4. Update
  5. Additional Packages and Fonts


You will see name texmf everywhere. It stands for TEX and METAFONT (an old language Knuth used to design fonts).


To setup a TeX system, you need to do finish two tasks:

  1. Install TeX by a distribution, like TeXLive, MiKTeX etc.
  2. Manage TeX system by built-in texconfig or tlmgr of TeXLive, the later of which is far more powerful.
    1. Install, update, uninstall, backup individual TeX packages.
    2. Change installation options like paper size and source location.

    You can regard tlmgr as package manager similar to dnf, emerge etc.

  3. Leave TeX installation in a standalone directory. Do not spread it across the LFS.


OS Package Manager

By default, the XeTeX engin is not installed. Hence, put it on command line too:

~ $ dnf install texlive texlive-xetex

Installation from package manager is a minimal install and may lack some fundamental TeX packages.

Net Installer

Net Installer is recommended by TeXLive, but limited by local bandwidth and is prone to network abrupt.

The advantage by net installer is you get the latest updates.


It's recommended to do a full install from ISO.


  1. Spare at least 10G disk space.
  2. Download the ISO (around 5G).
  3. Outline the texmf trees by TeX varaibles

    All of the trees shoulf follow TeX Directory Structure (TDS).

    TEXDIR, TEXMFROOT (the main TeX directory):
    TEXMFDIST, TEXMFMAIN (The principal tree containing the core of TeX):
    TEXMFLOCAL (directory for site-wide local files):
    TEXMFHOME (directory for user-specific files):
    TEXMFSYSVAR (directory for variable and automatically generated data):
    TEXMFVAR (personal directory for variable and automatically generated data):
    TEXMFSYSCONFIG (directory for local config):
    TEXMFCONFIG (personal directory for local config):

    These TeX variables can be overriden by system environment variables like TEXLIVE_INSTALL_TEXDIR. Check install-tl --help for details.

Installation from ISO

~ # mkdir -p /mnt/iso; cd /mnt/iso
~ # mount /path/to/texlive.iso .

# text mode
~ # per ./install-tl

# GUI mode
~ # per ./install-tl -gui

Leave the default settings (full installation) if you dunno what you are doing. There is an option:

create symlinks in standard directories

Please leave it it uncheck, which otherwise may ruin your system bin directories.

It may take half an hour to complete the installation.

TeX environment variables for Unix

There may exist multiple TeX distributions installed alongside. So, it's better to create a current version symlink.

~ # cd /usr/local/texlive/
~ # ln -sv 2020 current 

Mainly, adjust the search path.

PATH=/usr/local/texlive/current/bin/x86_64-linux:$PATH; export PATH
MANPATH=/usr/local/texlive/current/texmf-dist/doc/man:$MANPATH; export MANPATH
INFOPATH=/usr/local/texlive/current/texmf-dist/doc/info:$INFOPATH; export INFOPATH

Check Installation Scheme

tlmgr will reveal everythin about the setup.

~ # tlmgr --help
~ # tlmgr conf

~ # kpsewhich -a texmf.cnf
~ # kpsewhich -var-value=TEXMFHOME

~ # kpsewhich foo.sty
~ # kpsewhich bar.cls


It is highly recommened not to update TeX distribution in place. Instead, you'd better install a new distribution version. Alternatively, please update or install individual packages into TEXMFLOCAL or TEXMFHOME.

  1. Where should we get updates from?

    By default, the

    after install, set CTAN as source for package updates

    option is checked upon installation.

    But we can manually set the update repository afterwards:

    ~ # tlmgr option repository http://mirror.ctan.org/systems/texlive/tlnet

    This tells tlmgr to use a nearby CTAN mirror for future updates.

  2. How to update?

    # GUI
    ~ # tlmgr -gui
    # Text
    ~ # tlmgr update -all -dry-run
    ~ # tlmgr update -list
    ~ # tlmgr update -all
    ~ # tlmgr -repository /local/mirror/tlnet install collection-xetex
    ~ # tlmgr show collection-latexextra

Additional Packages and Fonts

Additional new or updated packages and fonts are expected to be in TEXMFLOCAL (system-wide) or TEXMFHOME (per-user, RECOMMENDED), independent of TeX distributions.

For changes under TEXMFLOCAL, we should update the search path for Kpathsea, as TEXMFLOCAL is prefixed with double !!in texmf.cnf.

~ # mktexlsr [/usr/local/telive/texmf-local/]
# -or-
~ # mktexlsr [$(kpsewhich -var-value=TEXMFLOCAL)]

~ # kpsewhich foobar.sty
  1. mktexls acutally just creates a file named ls-R under the specified directory.

    Without the directory argument, mktexlsr tries updates all ls-R for the installation.

  2. You can also use texhash as it is just a symlink to mktexlsr.