# Texlive-2020's lualatex fails to compile due to "no writeable cache path". Texlive-2019's lualatex works fine

After upgrading my texlive distribution to v2020 on my linux machine lualatex stopped working altogether producing the same fatal error for all projects. Even compiling the following minimal source file main.tex using lualatex --interaction=batchmode main.tex

\documentclass{article}

\begin{document}
\end{document}


yields the following errors:

This is LuaHBTeX, Version 1.12.0 (TeX Live 2020)
restricted system commands enabled.
stack traceback:
[\directlua]:1: in main chunk


The Texlive-2019 version of lualatex as well as both pdflatex versions work fine and produce an empty document without errors.

As I've used the official texlive installer and its suggested default settings to install both distributions (to /usr/local/texlive/2019/... and /usr/local/texlive/2020/..., respectively) I am utterly clueless as to what may be the problem here since I haven't had any problems with the 2019 distribution.

Any help? Thanks!

update: I managed to get it to work by explicitly setting the TEXMFVAR environment variable to $HOME/.texlive2020/texmf-var which is the default value suggested by the installer script. Did I make a mistake during the installation process? I didn't have to export the envvar before. The output of kpsewhich -var-value=TEXMFCACHE is /usr/local/texlive/2020/texmf-var:/usr/local/texlive/2020/texmf-var  • Welcome to TeX StackExchange! What is the output of kpsewhich -var-value=TEXMFCACHE on your system (under TeX Live 2020)? Feb 10, 2021 at 13:32 • @MarcelKrüger I updated the question to contain the output. Does that suggest what the problem might be? Feb 10, 2021 at 15:55 • For some reason you got a weird TEXMFVAR, but it's hard to say why. You might want to look into "/usr/local/texlive/2020/texmf.cnf". Maybe you set TEXMFVAR to something there? (e.g. because you changed it in the installer) Feb 10, 2021 at 21:08 • The texmf.cnf explicitly listed TEXMFVAR = TEXMFSYSVAR which may explain the problem. I set TEXMFVAR =$HOME/.cache/texlive2020/texmf-var which solves the problem without having to export any environment variables. Feb 11, 2021 at 9:59

I manually set the TEXTMFHOME and TEXMFVAR parameters inside the /usr/local/texlive/2020/texmf.cnf configuration file to refer to local directories which solved the problem.
TEXMFHOME = $HOME/.cache/texlive2020 TEXMFVAR =$HOME/.cache/texlive2020/texmf-var/