Introduction to TeX Live from source

Most of TeX Live can be built from source without a pre-existing installation, but xindy (for indexing) needs working versions of latex and pdflatex when configure is run, and the testsuite and install for asy (for vector graphics) will fail if TeX has not already been installed. Additionally, biber is not provided within the texlive source.

All of those packages are dealt with on their own pages and can be built after installing this package. If you have not already done so, you should start at Setting the PATH for TeX Live so that the final commands to initialise the new installation will be found.

This package is known to build and work properly using an LFS-8.3 platform.

Package Information

  • Download (FTP): ftp://tug.org/texlive/historic/2018/texlive-20180414-source.tar.xz

  • Download MD5 sum: 41d1e8874d266935c656fe51b440a413

  • Download size: 48 MB

  • Estimated disk space required: 6.5 GB including the additional download (+179 MB for the tests), 5.3 GB installed

  • Estimated build time: 9.8 SBU including the additional download (+0.3 SBU for the tests)

Required Additional Downloads

Much of the texlive environment (including scripts, documentation, fonts and various other files) is not part of the source tarball. You must download it separately. This will give you all of the additional files which are provided by a full install of the binary version, there is no realistic way to restrict which parts get installed.

Because of the size of this package, it is unlikely to be mirrored by BLFS mirrors. In case of difficulty, go to http://www.ctan.org/mirrors/ to find a more-accessible mirror.

TeX Live from source Dependencies



The source ships with its own versions of several libraries which are either not under active development, or only used for limited functionality. If you install these, as with some other optional dependencies in this book you will need to tell configure to use the system versions. GD, t1lib, ZZIPlib, TECkit

Runtime dependencies

User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/texlive

Installation of TeX Live

Install TeX Live by running the following commands:

The shared libraries will be installed into a texlive directory. As the root user, add it to your /etc/ld.so.conf:

cat >> /etc/ld.so.conf << EOF
# Begin texlive 2018 addition


# End texlive 2018 addition


From 2015 onwards, a successful install requires some texlive commands to be run as the root user, so we will export the TEXARCH variable to let root use it.

Now, as a normal user:

export TEXARCH=$(uname -m | sed -e 's/i.86/i386/' -e 's/$/-linux/') &&

patch -Np1 -i ../texlive-20180414-source-upstream_fixes-1.patch &&

mv -v texk/web2c/pdftexdir/pdftoepdf{-newpoppler,}.cc &&
mv -v texk/web2c/pdftexdir/pdftosrc{-newpoppler,}.cc  &&

mkdir texlive-build &&
cd texlive-build    &&

../configure                                                    \
    --prefix=/opt/texlive/2018                                  \
    --bindir=/opt/texlive/2018/bin/$TEXARCH                     \
    --datarootdir=/opt/texlive/2018                             \
    --includedir=/opt/texlive/2018/include                      \
    --infodir=/opt/texlive/2018/texmf-dist/doc/info             \
    --libdir=/opt/texlive/2018/lib                              \
    --mandir=/opt/texlive/2018/texmf-dist/doc/man               \
    --disable-native-texlive-build                              \
    --disable-static --enable-shared                            \
    --with-system-cairo                                         \
    --with-system-fontconfig                                    \
    --with-system-freetype2                                     \
    --with-system-gmp                                           \
    --with-system-graphite2                                     \
    --with-system-harfbuzz                                      \
    --with-system-icu                                           \
    --with-system-libgs                                         \
    --with-system-libpaper                                      \
    --with-system-libpng                                        \
    --with-system-mpfr                                          \
    --with-system-pixman                                        \
    --with-system-poppler                                       \
    --with-system-potrace                                       \
    --with-system-xpdf                                          \
    --with-system-zlib                                          \
    --with-banner-add=" - BLFS" &&


To test the results, issue: make check A few tests may SKIP because kpathsea has not yet been installed.

Now, as the root user:

make install-strip &&
/sbin/ldconfig &&
make texlinks &&
mkdir -pv /opt/texlive/2018/tlpkg/TeXLive/ &&
install -v -m644 ../texk/tests/TeXLive/* /opt/texlive/2018/tlpkg/TeXLive/


Only run make texlinks once. If it is rerun, it can change all the program symlinks so that they point to themselves and are useless.

Now install the additional files as the root user:

tar -xf ../../texlive-20180414-texmf.tar.xz -C /opt/texlive/2018 --strip-components=1

Still as the root user, initialise the new system (the commands fmtutil-sys --all and mtxrun --generate will produce a lot of output):

mktexlsr &&
fmtutil-sys --all &&
mtxrun --generate

You can now proceed to asymptote-2.47, biber-2.11 and / or xindy-2.5.1 if you wish to install them.

Command Explanations

patch -Np1 -i ../texlive-20180414-source-upstream_fixes-1.patch: various problems have come to light since the shipped source was frozen to be committed to DVDs. In particular, a segmentation fault in dvipdfm-x from XeTeX and changes in upstream poppler-0.64.0.

mv -v texk/web2c/pdftexdir/pdftoepdf{-newpoppler,}.cc ...: The 2018 version of texlive ships with support for poppler-0.57.0 and older, but it includes alternative newpoppler files which enable building with poppler-0.62.0 or newer.

--prefix=, --bindir=, --datarootdir=, --infodir=, --mandir= ... : these switches ensure that the files installed from source will overwrite any corresponding files previously installed by install-tl-unx so that the alternative methods of installing texlive are consistent..

--includedir=, --libdir= ... : these switches ensure that the libraries and include files will be within the directories for this year's texlive.

--disable-static: This switch prevents installation of static versions of the libraries.

--enable-shared: Use shared versions of libkpathsea, libptexenc, libsynctex, libtexlua52 and libtexluajit.

--with-system-...: Unless this parameter is used, the included versions of these libraries will be statically compiled into the programs which need them. If you decided not to install a recommended library, omit the corresponding switch.

--with-system-xpdf: Uniquely, this parameter has a non-standard meaning, it tells configure to use the system-installed poppler headers and library. Again, omit this if you have not installed poppler.

--without-x: use this if you do not have Xorg installed.

/sbin/ldconfig: this has to be run here so that make texlinks can use kpsewhich.

make texlinks : this runs the texlinks.sh script to create symbolic links from formats to engines. In practice, several of the targets such as xetex are now separate binaries and for these it will report "file already exists".

tar -xf texlive-20180414-texmf.tar.xz -C /opt/texlive/2018 --strip-components=1: the tarball contains the files for the texmf-dist directory, and because of its size we do not want to waste time and space untarring it and then copying the files.

install -v -m644 ../texk/tests/TeXLive/* /opt/texlive/2018/tlpkg/TeXLive/: This puts the perl modules TLConfig.pm and TLUtils.pm into the directory where the binary installer puts them - it is at the start of the perl @INC@ PATH within texlive when installed using the above configure switches. Without these modules, texlive is unusable.

mktexlsr: Create an ls-R file which lists what was installed - this is used by kpathsea to find files.

fmtutil-sys --all: This initialises the TeX formats, Metafont bases and Metapost mems.

mtxrun --generate: This initialise the ConTeXt system.


Installed Programs: Over 300 binaries and symlinks to scripts
Installed Libraries: libkpathsea.so, libptexenc.so, libsynctex.so, libtexlua52.so, libtexluajit.so
Installed Directories: /opt/texlive/2018/bin, /opt/texlive/2018/include, /opt/texlive/2018/lib, /opt/texlive/2018/texmf-dist

Short Descriptions

TeX programs

The programs included in TeX are too numerous to individually list. Please refer to the individual program HTML and PDF pages in the various html, man, or pdf files within the subdirectories of 2018/texmf-dist/. Using texdoc pdflatex ( replace pdflatex with the command name ) may also be useful.


(kpathsearch) exists to look up a file in a list of directories and is used by kpsewhich.


is a library for Japanese pTeX (publishing TeX).


is the SyncTeX (Synchronize TeXnology) parser library.


provides Lua 5.2, modified for use with LuaTeX.


provides LuaJIT, modified for use with LuaJITTeX.

Last updated on 2018-08-26 19:27:55 -0700