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

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).

-
Have you tried to call `tlmgr check all`? –  Paul Gaborit Jul 15 '13 at 8:30
There is no `<YEAR>/texmf` tree any more, so it's quite strange `fmtutil-sys` points to that directory. It's possible you have set some TeX-related variable in the environment. What does `env|grep TEX` print? –  egreg Jul 15 '13 at 10:56
@PaulGaborit: it exits unsuccessfully (status 1). –  BeSlayed Jul 15 '13 at 16:28
@BeSlayed Remove the setting of those variables from your environment. They are useless and the second is wrong, actually the most likely candidate to be the culprit. –  egreg Jul 15 '13 at 16:54
@BeSlayed It's quite normal that `tlmgr check all` finds some ‘inconsistency’. –  egreg Jul 15 '13 at 22:43

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.

-
Thanks again. I don't recall why I had defined those variables originally, but I had set them a number of years ago and kept "updating" them for new TeXLive versions. –  BeSlayed Jul 16 '13 at 2:22