Setting the PATH for TeX Live

#### Beyond Linux® From Scratch (System V Edition) - Version r13.0-584

### Chapter 51. Typesetting

- Prev

  Typesetting

- Next

  install-tl-unx

- Up
- Home

# Setting the PATH for TeX Live

Upstream prefers to install in `/usr/local` but the BLFS editors regard that as inconvenient, and think using `/opt/texlive` is more appropriate. Originally BLFS used a full binary install to bootstrap the source install, so the same prefix is used for both.

Before starting to build TeX Live, set up your PATH so that the system can properly find the files. If you set up your login scripts as recommended in The Bash Shell Startup Files, update the needed paths by creating the `texlive.sh` script. The programs are always installed in an <ARCH>-linux subdirectory and on 32-bit x86 this is always i386-linux. For x86_64 and i?86 we can generate this as $TEXARCH:

### Note

If upgrading from a previous year's version, you should manually edit `texlive.sh` to ensure that the version for the year you wish to use is the only TeX present (some people need to keep multiple years available to ensure there are no regressions in their documents).

Now, create the texlive.sh script as the `root` user:

    TEXARCH=$(uname -m | sed -e 's/i.86/i386/' -e 's/$/-linux/')
    TEXLIVE_PREFIX=/opt/texlive/2025

    cat > /etc/profile.d/texlive.sh << EOF
    # Begin texlive setup
    TEXLIVE_PREFIX=/opt/texlive/2025
    export TEXLIVE_PREFIX

    pathappend $TEXLIVE_PREFIX/texmf-dist/doc/info INFOPATH
    pathappend $TEXLIVE_PREFIX/bin/$TEXARCH

    TEXMFCNF=$TEXLIVE_PREFIX/texmf-dist/web2c
    export TEXMFCNF

    # End texlive setup
    EOF

    unset TEXARCH

The new paths can be immediately activated by running:

    source /etc/profile

You should now proceed either to install-tl-unx for a binary installation of texlive, or to texlive-20250308 to begin installing from source.

- Prev

  Typesetting

- Next

  install-tl-unx

- Up
- Home