Building this Dockerfile
FROM texlive/texlive:latest-minimal # 76d39535e480
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get upgrade -y && rm -rf /var/lib/apt/lists/*
RUN tlmgr update --self && tlmgr install scheme-full
fails with non-zero code 2, but previous build (several months ago) was ok.
The error shows in the last part of the build, one error following all package installation, another error near the end of the log, see below.
...
[4411/4412, 44:50/44:50] install: collection-xetex [1k]
[4412/4412, 44:51/44:51] install: scheme-full [1k]
running mktexlsr ...
done running mktexlsr.
running mtxrun --generate ...
tlmgr: mtxrun --generate failed (status -1), output:
running updmap-sys ...
done running updmap-sys.
regenerating language.dat
regenerating language.def
regenerating language.dat.lua
regenerating fmtutil.cnf in /usr/local/texlive/2022/texmf-dist
running fmtutil-sys --byengine hitex --no-error-if-no-format --no-error-if-no-engine=luajithbtex,luajittex,mfluajit --status-file=/tmp/LTvdge0FWk/deFZm0cUtU ...
OK: hitex.fmt/hitex
running fmtutil-sys --byengine uptex --no-error-if-no-format --no-error-if-no-engine=luajithbtex,luajittex,mfluajit --status-file=/tmp/LTvdge0FWk/deFZm0cUtU ...
OK: uptex.fmt/uptex
running fmtutil-sys --byengine eptex --no-error-if-no-format --no-error-if-no-engine=luajithbtex,luajittex,mfluajit --status-file=/tmp/LTvdge0FWk/deFZm0cUtU ...
OK: eptex.fmt/eptex platex-dev.fmt/eptex platex.fmt/eptex
running fmtutil-sys --byengine ptex --no-error-if-no-format --no-error-if-no-engine=luajithbtex,luajittex,mfluajit --status-file=/tmp/LTvdge0FWk/deFZm0cUtU ...
OK: ptex.fmt/ptex
running fmtutil-sys --byengine aleph --no-error-if-no-format --no-error-if-no-engine=luajithbtex,luajittex,mfluajit --status-file=/tmp/LTvdge0FWk/deFZm0cUtU ...
OK: aleph.fmt/aleph
running fmtutil-sys --byengine xetex --no-error-if-no-format --no-error-if-no-engine=luajithbtex,luajittex,mfluajit --status-file=/tmp/LTvdge0FWk/deFZm0cUtU ...
OK: xetex.fmt/xetex pdfcsplain.fmt/xetex cont-en.fmt/xetex xelatex.fmt/xetex xelatex-dev.fmt/xetex
running fmtutil-sys --byengine luajittex --no-error-if-no-format --no-error-if-no-engine=luajithbtex,luajittex,mfluajit --status-file=/tmp/LTvdge0FWk/deFZm0cUtU ...
OK: luajittex.fmt/luajittex
running fmtutil-sys --byengine euptex --no-error-if-no-format --no-error-if-no-engine=luajithbtex,luajittex,mfluajit --status-file=/tmp/LTvdge0FWk/deFZm0cUtU ...
OK: euptex.fmt/euptex uplatex-dev.fmt/euptex uplatex.fmt/euptex
running fmtutil-sys --byengine luajithbtex --no-error-if-no-format --no-error-if-no-engine=luajithbtex,luajittex,mfluajit --status-file=/tmp/LTvdge0FWk/deFZm0cUtU ...
OK: luajithbtex.fmt/luajithbtex
running fmtutil-sys --byfmt lualatex-dev --no-error-if-no-engine=luajithbtex,luajittex,mfluajit --status-file=/tmp/LTvdge0FWk/deFZm0cUtU ...
OK: lualatex-dev.fmt/luahbtex
running fmtutil-sys --byfmt mex --no-error-if-no-engine=luajithbtex,luajittex,mfluajit --status-file=/tmp/LTvdge0FWk/deFZm0cUtU ...
OK: mex.fmt/pdftex
running fmtutil-sys --byfmt pdfxmltex --no-error-if-no-engine=luajithbtex,luajittex,mfluajit --status-file=/tmp/LTvdge0FWk/deFZm0cUtU ...
OK: pdfxmltex.fmt/pdftex
running fmtutil-sys --byfmt pdfjadetex --no-error-if-no-engine=luajithbtex,luajittex,mfluajit --status-file=/tmp/LTvdge0FWk/deFZm0cUtU ...
OK: pdfjadetex.fmt/pdftex
running fmtutil-sys --byfmt mllatex --no-error-if-no-engine=luajithbtex,luajittex,mfluajit --status-file=/tmp/LTvdge0FWk/deFZm0cUtU ...
OK: mllatex.fmt/pdftex
running fmtutil-sys --byfmt dvilualatex-dev --no-error-if-no-engine=luajithbtex,luajittex,mfluajit --status-file=/tmp/LTvdge0FWk/deFZm0cUtU ...
OK: dvilualatex-dev.fmt/luatex
running fmtutil-sys --byfmt utf8mex --no-error-if-no-engine=luajithbtex,luajittex,mfluajit --status-file=/tmp/LTvdge0FWk/deFZm0cUtU ...
OK: utf8mex.fmt/pdftex
running fmtutil-sys --byfmt pdfcslatex --no-error-if-no-engine=luajithbtex,luajittex,mfluajit --status-file=/tmp/LTvdge0FWk/deFZm0cUtU ...
OK: pdfcslatex.fmt/pdftex
running fmtutil-sys --byfmt pdfmex --no-error-if-no-engine=luajithbtex,luajittex,mfluajit --status-file=/tmp/LTvdge0FWk/deFZm0cUtU ...
OK: pdfmex.fmt/pdftex
running fmtutil-sys --byfmt latex-dev --no-error-if-no-engine=luajithbtex,luajittex,mfluajit --status-file=/tmp/LTvdge0FWk/deFZm0cUtU ...
OK: latex-dev.fmt/pdftex
running fmtutil-sys --byfmt xmltex --no-error-if-no-engine=luajithbtex,luajittex,mfluajit --status-file=/tmp/LTvdge0FWk/deFZm0cUtU ...
OK: xmltex.fmt/pdftex
running fmtutil-sys --byfmt latex --no-error-if-no-engine=luajithbtex,luajittex,mfluajit --status-file=/tmp/LTvdge0FWk/deFZm0cUtU ...
OK: latex.fmt/pdftex
running fmtutil-sys --byfmt cslatex --no-error-if-no-engine=luajithbtex,luajittex,mfluajit --status-file=/tmp/LTvdge0FWk/deFZm0cUtU ...
OK: cslatex.fmt/pdftex
running fmtutil-sys --byfmt lualatex --no-error-if-no-engine=luajithbtex,luajittex,mfluajit --status-file=/tmp/LTvdge0FWk/deFZm0cUtU ...
OK: lualatex.fmt/luahbtex
running fmtutil-sys --byfmt eplain --no-error-if-no-engine=luajithbtex,luajittex,mfluajit --status-file=/tmp/LTvdge0FWk/deFZm0cUtU ...
OK: eplain.fmt/pdftex
running fmtutil-sys --byfmt lollipop --no-error-if-no-engine=luajithbtex,luajittex,mfluajit --status-file=/tmp/LTvdge0FWk/deFZm0cUtU ...
OK: lollipop.fmt/tex
running fmtutil-sys --byfmt texsis --no-error-if-no-engine=luajithbtex,luajittex,mfluajit --status-file=/tmp/LTvdge0FWk/deFZm0cUtU ...
OK: texsis.fmt/pdftex
running fmtutil-sys --byfmt csplain --no-error-if-no-engine=luajithbtex,luajittex,mfluajit --status-file=/tmp/LTvdge0FWk/deFZm0cUtU ...
OK: csplain.fmt/pdftex
running fmtutil-sys --byfmt pdflatex --no-error-if-no-engine=luajithbtex,luajittex,mfluajit --status-file=/tmp/LTvdge0FWk/deFZm0cUtU ...
OK: pdflatex.fmt/pdftex
running fmtutil-sys --byfmt amstex --no-error-if-no-engine=luajithbtex,luajittex,mfluajit --status-file=/tmp/LTvdge0FWk/deFZm0cUtU ...
OK: amstex.fmt/pdftex
running fmtutil-sys --byfmt luacsplain --no-error-if-no-engine=luajithbtex,luajittex,mfluajit --status-file=/tmp/LTvdge0FWk/deFZm0cUtU ...
OK: luacsplain.fmt/luatex
running fmtutil-sys --byfmt optex --no-error-if-no-engine=luajithbtex,luajittex,mfluajit --status-file=/tmp/LTvdge0FWk/deFZm0cUtU ...
OK: optex.fmt/luatex
running fmtutil-sys --byfmt dvilualatex --no-error-if-no-engine=luajithbtex,luajittex,mfluajit --status-file=/tmp/LTvdge0FWk/deFZm0cUtU ...
OK: dvilualatex.fmt/luatex
running fmtutil-sys --byfmt pdflatex-dev --no-error-if-no-engine=luajithbtex,luajittex,mfluajit --status-file=/tmp/LTvdge0FWk/deFZm0cUtU ...
OK: pdflatex-dev.fmt/pdftex
running fmtutil-sys --byfmt mptopdf --no-error-if-no-engine=luajithbtex,luajittex,mfluajit --status-file=/tmp/LTvdge0FWk/deFZm0cUtU ...
OK: mptopdf.fmt/pdftex
running fmtutil-sys --byfmt jadetex --no-error-if-no-engine=luajithbtex,luajittex,mfluajit --status-file=/tmp/LTvdge0FWk/deFZm0cUtU ...
OK: jadetex.fmt/pdftex
running fmtutil-sys --byfmt mltex --no-error-if-no-engine=luajithbtex,luajittex,mfluajit --status-file=/tmp/LTvdge0FWk/deFZm0cUtU ...
OK: mltex.fmt/pdftex
running fmtutil-sys --byhyphen "/usr/local/texlive/2022/texmf-var/tex/generic/config/language.dat" --no-error-if-no-engine=luajithbtex,luajittex,mfluajit --status-file=/tmp/LTvdge0FWk/deFZm0cUtU ...
OK: pdflatex-dev.fmt/pdftex latex-dev.fmt/pdftex dvilualatex-dev.fmt/luatex uplatex.fmt/euptex uplatex-dev.fmt/euptex lualatex.fmt/luahbtex platex-dev.fmt/eptex pdfjadetex.fmt/pdftex pdflatex.fmt/pdftex dvilualatex.fmt/luatex platex.fmt/eptex xelatex-dev.fmt/xetex xelatex.fmt/xetex mllatex.fmt/pdftex eplain.fmt/pdftex jadetex.fmt/pdftex xmltex.fmt/pdftex latex.fmt/pdftex lualatex-dev.fmt/luahbtex pdfxmltex.fmt/pdftex
running fmtutil-sys --byhyphen "/usr/local/texlive/2022/texmf-var/tex/generic/config/language.def" --no-error-if-no-engine=luajithbtex,luajittex,mfluajit --status-file=/tmp/LTvdge0FWk/deFZm0cUtU ...
OK: luajittex.fmt/luajittex luajithbtex.fmt/luajithbtex hitex.fmt/hitex luatex.fmt/luatex euptex.fmt/euptex luahbtex.fmt/luahbtex eptex.fmt/eptex xetex.fmt/xetex pdftex.fmt/pdftex etex.fmt/pdftex dviluatex.fmt/luatex pdfetex.fmt/pdftex
running fmtutil-sys --byhyphen "/usr/local/texlive/2022/texmf-var/tex/generic/config/language.dat.lua" --no-error-if-no-engine=luajithbtex,luajittex,mfluajit --status-file=/tmp/LTvdge0FWk/deFZm0cUtU ...
tlmgr: An error has occurred. See above messages. Exiting.
tlmgr: package log updated: /usr/local/texlive/2022/texmf-var/web2c/tlmgr.log
tlmgr: command log updated: /usr/local/texlive/2022/texmf-var/web2c/tlmgr-commands.log
The command '/bin/sh -c tlmgr update --self && tlmgr install scheme-full' returned a non-zero code: 2
The error message suggests further output above for diagnosis, but I could not find them in the output or in the filesystem, so I'm unable to debug further.
I encountered the same error when trying to install scheme-full in overleaf server image. The error is in the middle of the installation, where mtxrun
could not be found.
The problem is that, running tlmgr path add
is required again after every use of tlmgr install, in order to correctly symlink all the binaries into the system path (according to Overleaf Quick Start Guide). This command will link /usr/local/texlive/2022/bin/x86_64-linux/mtxrun
to /usr/local/bin/mtxrun
, after which we are able to execute mtxrun
.
Initially, we don't have mtxrun
on our system. tlmgr install scheme-full
will install mtxrun
to /usr/local/texlive/2022/bin/x86_64-linux
, but it is not executable yet, because it is not linked to /usr/local/bin/mtxrun
. Now tlmgr was trying to execute it before it got linked, so it failed.
A possible solution is to add /usr/local/texlive/2022/bin/x86_64-linux
to path before executing tlmgr install
. Add the following line before the second RUN
fixes the problem:
ENV PATH="$PATH:/usr/local/texlive/2022/bin/x86_64-linux"