When I try to compile some TeX code from a few years ago that relies on the siunitx
package, I get the following error:
! LaTeX3 Error: Mismatched LaTeX support files detected.
(LaTeX3) Loading 'expl3.sty' aborted!
(LaTeX3)
(LaTeX3) The L3 programming layer in the LaTeX format
(LaTeX3) is dated 2021-02-18, but in your TeX tree the files require
(LaTeX3) at least 2021-05-11.
For immediate help type H <return>.
...
l.77 \ExplLoaderFileDate{expl3.sty}}
%
The code itself is not relevant; the error can be reproduced by compiling, say, the following MWE:
\documentclass{article}
\usepackage{siunitx}
\begin{document}
\SI{1}{\s}
\end{document}
I have just updated my TeX Live 2021 distribution and furthermore I haven't encountered this error before.
How do I fix this?
kpsewhich --all --engine=pdftex pdflatex.fmt
? (assuming you are using pdfTeX)[<username>@localhost test]$ kpsewhich --all --engine=pdftex pdflatex.fmt /home/<username>/.texlive2021/texmf-var/web2c/pdftex/pdflatex.fmt /usr/local/texlive/2021/texmf-var/web2c/pdftex/pdflatex.fmt
/home/<username>/.texlive2021/texmf-var/web2c/pdftex/pdflatex.fmt
and it should work