[Tex/LaTex] TeXLive 2013 (on Linux/Ubuntu) – tcfmgr & fmtutil not found

errorstexliveUbuntu

When I try to update packages via tlmgr (or run fmtutil-sys --all directly), TeXLIve reports:

/usr/local/texlive/2013/bin/i386-linux/fmtutil: 395: /usr/local/texlive/2013/bin/i386-linux/fmtutil: /usr/local/texlive/2013/texmf/texconfig/tcfmgr: not found
fmtutil: config file `fmtutil.cnf' not found.

kpsewhich fmtutil.cnf reports "/usr/local/texlive/2013/texmf-var/web2c/fmtutil.cnf"

This was a clean install of TeX Live 2013, so I'm not sure what went wrong (or how to fix it).

Best Answer

You have set the variables TEXMF and TEXMFLOCAL in your environment, which is not unrecommended.

The TeX programs in the TeX Live distribution are able to figure out the right value for these variables at runtime, by reading the texmf.cnf files they find in the appropriate locations. Such locations are determined by asking the system where the running binary is located. In a typical (vanilla) TeX Live 2013, binaries are stored in

/usr/local/texlive/2013/bin/<arch>

(where <arch> depends on the machine and running operating system). From asking the operating system, the running program knows the value of SELFAUTOPARENT, in this case /usr/local/texlive/2013 and tries to read a texmf.cnf file there, if existent. Then it reads

/usr/local/texlive/2013/texmf-dist/web2c/texmf.cnf

and this is where your setting failed. The TeX programs never override the value of a variable that has already been set. So the second texmf.cnf file doesn't set TEXMF to the correct value for the 2013 distribution, which should be

/usr/local/texlive/2013/texmf-dist

while TeX Live 2012 set it to /usr/local/texlive/2012/texmf. This is where the thing went wrong.

Moral of the story: never set the TEX... variables in the environment, with the possible exception of TEXINPUTS. Other ...INPUTS variables can also be set, check the documentation.