35

I updated my TeXlive distribution a couple times in the past week, and now I get this error when I include package expl3 (or any other package that includes it, such as fontspec). Before the updates it was working fine. Am I missing any package that should be installed? I tried searching for l3backend-pdfmode.def, but I found no results.

\documentclass{article}
\usepackage{expl3}
\begin{document}
Hi
\end{document}
λ lualatex a
This is LuaTeX, Version 1.10.0 (TeX Live 2019) 
 restricted system commands enabled.
(./a.tex
LaTeX2e <2018-12-01>

luaotfload | main : initialization completed in 0.042 seconds
(/opt/texlive/2019/texmf-dist/tex/latex/base/article.cls
Document Class: article 2018/09/03 v1.4i Standard LaTeX document class
(/opt/texlive/2019/texmf-dist/tex/latex/base/size10.clo))
(/opt/texlive/2019/texmf-dist/tex/latex/l3kernel/expl3.sty
(/opt/texlive/2019/texmf-dist/tex/latex/l3kernel/expl3-code.tex)

! LaTeX Error: File `l3backend-pdfmode.def' not found.

Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: def)

Enter file name: 
! Emergency stop.
<read *> 

l.282   }

 379 words of node memory still in use:
   2 hlist, 1 rule, 1 dir, 3 kern, 1 glyph, 4 attribute, 48 glue_spec, 4 attrib
ute_list, 1 write nodes
   avail lists: 2:9,3:3,4:1,5:2,7:2,9:2
!  ==> Fatal error occurred, no output PDF file produced!
Transcript written on a.log.
Claudio
  • 2,007
  • 6
    The code has been moved to a dedicated package. Install the l3backend package. – Ulrike Fischer Jul 08 '19 at 09:18
  • That works. I tried to tlmgr search l3backend but I forgot that it only searches locally by default, and I did not find anything. – Claudio Jul 08 '19 at 09:33
  • May I ask how you update your texlive? Whenever I update I also get all the new packages, and thus aren't missing stuff like this module split. – daleif Jul 08 '19 at 17:01
  • @daleif tlmgr update --all, possibly also tlmgr update --self if it complains. However, this was a minimal installation, so maybe that package should have been pulled in by some collection that was not installed (I am assuming, I am not sure how tlmgr works exactly) – Claudio Jul 08 '19 at 19:52
  • That might explain it (that it was missing from a collection) as I always install everything – daleif Jul 08 '19 at 19:53
  • The only collections I have installed are collection-basic, collection-langenglish, collection-latex, collection-luatex. Every other package was installed manually. No idea what collections l3kernel and l3backend belong. – Claudio Jul 08 '19 at 20:00
  • @Claudio tlmgr info l3backend says collection-latexrecommended, as I installed everything I got l3backend as an automatic install as I updated today – daleif Jul 09 '19 at 08:45
  • I'm running Texlive 2019 on Linux and I get the same error. The package is installed (I checked with tlmgr info l3backend). All packages are up to date and the only missing packages from my installation are those for Windows. Any suggestions? – Taekwondavide Jul 16 '19 at 17:51
  • @Taekwondavide Do you get exactly "Missing l3backend-pdfmode.def"? Does that file exist on your system? tlmgr search --all l3backend should give something like texmf-dist/tex/latex/l3backend/l3backend-pdfmode.def – Claudio Jul 18 '19 at 07:03
  • @Claudio the error (from TeXstudio log) is File 'l3backend-pdfmode.def' not found. }. The file is present in folder /usr/local/texlive/2019/texmf-dist/tex/latex/l3backend. – Taekwondavide Jul 18 '19 at 22:42
  • The error has been solved by running mktexlsr as suggested by @Phelype Oleinik – Taekwondavide Jul 18 '19 at 23:22

3 Answers3

55

For Windows:

  1. Open the MikTeX Console
  2. Check for Update
  3. Updates > Update Now
  4. Search l3backend package
  5. Install the package
  • 4
    This is exactly what I was looking for. :D – Octfx Jul 12 '19 at 08:42
  • 3
    Solved it for me perfectly. Thanks! – liamcomp Aug 22 '19 at 14:54
  • 1
    When I update, I get something went wrong while checking for update. Invalid argument: path="C:\Users\id917977\AppData\Local\MiKTeX\2.9\miktex/data/le\df2c24cb21984fa85003c1ecc818ff83.fndb" – aan Sep 25 '19 at 13:27
  • Does adding \usepackage{l3backend} to the preamble of your document tell MikTeX what it should be looking for to avoid manual package installation? – rbrignall Nov 05 '19 at 10:51
  • Similar process for Mac (High Sierra):
    1. Press CMD + Space Bar to search
    2. Serach & Open MikTeX Console
    3. Click "Reopen as Administrator"
    4. Check for Updates
    5. Updates > Update Now.

    I personally didn't need to install anything additional.

    – hungryformath Apr 20 '20 at 20:12
28

Since the July 1st, 2019 release of the LaTeX3 kernel, the driver-specific code contained in the l3backend module was moved to a dedicated package in CTAN, and now l3backend is a dependency of l3kernel.

The description of l3backend on CTAN says:

The func­tions here are de­fined dif­fer­ently de­pend­ing on the en­gine in use. As such, these are dis­tributed sep­a­rately from l3k­er­nel to al­low this code to be up­dated on an in­de­pen­dent sched­ule.

So if you updated l3kernel only without installing l3backend as well you'll get an error like this:

($TEXMFROOT/texmf-dist/tex/latex/l3kernel/expl3-code.tex)

! LaTeX Error: File `l3backend-<driver-name>.def' not found.

Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: def)

Enter file name: 

and the solution is to install the missing l3backend package.

moewe
  • 175,683
  • 2
    The package was already installed but I still get the error... I'm using texlive 2019 on Linux... – Taekwondavide Jul 17 '19 at 15:01
  • 1
    @Taekwondavide If l3backend is correctly installed the error should disappear. How did you install the package? What happens if you type tlmgr info l3backend in a terminal? – Phelype Oleinik Jul 17 '19 at 19:57
  • I downloaded and installed the full TeX Live 2019 distrubution from their website (I did not use Linux repositories). Everything worked fine until I updated all packages with tlmgr. If I type that command it says that the package is installed. If I open tlmgr GUI it says it is installed, the only missing packags are those specific for WIN32. I updated the package list from different CTAN mirrors and nothing change. – Taekwondavide Jul 18 '19 at 15:52
  • 1
    @Taekwondavide Did you update with tlmgr update --all? If you didn't, try it: it should update all packages and install missing ones. Does kpsewhich -a l3backend-pdfmode.def return something? If nothing works, I suggest you ask a new question, more people will see it :-) – Phelype Oleinik Jul 18 '19 at 20:52
  • I updated from tlmgr --gui. If I run tlmgr update --all it says that no updates are available. The output of kpsewhich is empty, however the file is present in folder /usr/local/texlive/2019/texmf-dist/tex/latex/l3backend. – Taekwondavide Jul 18 '19 at 22:56
  • 1
    @Taekwondavide Hm... try running mktexlsr to generate the filename database for kpathsea. Run kpsewhich -a l3backend-pdfmode.def again after that. – Phelype Oleinik Jul 18 '19 at 23:14
  • Thank you! I've run mktexlsr and this solved the error. Also, kpsewhich now returns the path of the "missing" file. – Taekwondavide Jul 18 '19 at 23:20
  • 1
    @Taekwondavide Great :D I don't use the --gui much, so I don't know what it does, but apparently it didn't (for some reason) run mktexlsr after updating. mktexlsr generates the filename database which kpsewhich uses to locate the files in TeXLive. I imagined this was the problem after you said the file was there but kpsewhich didn't find it (just parroting for future readers: I'm afraid this problem will keep happening for some time :-). – Phelype Oleinik Jul 18 '19 at 23:37
  • I didn't find l3backend package. For me what solved it is to install l3kernel (miktex did it automatically when I did check for updates). – relG Oct 27 '19 at 12:26
  • I reinstalled both l3backend and l3kernel and I still have the same error. I am running Windows and MikTeX. Same error appears both on TeXStudio and LyX. Please help!! – Kasra Jan 26 '21 at 02:21
  • @Kasra Sorry, I don't use MiKTeX, so I won't be able to help you much. Please, ask a new question here, so some MiKTeX experts may help you – Phelype Oleinik Jan 26 '21 at 02:45
  • @ Phelype Oleinik. I looked all over the internet and NO answer. I gave up on MiKTeX (possibly forever). I switched to TeXLive and everything works fine now! – Kasra Jan 27 '21 at 04:26
  • @Kasra As I said, you could have asked a question (even though I also very much prefer TeX Live over MiKTeX :). Glad to know it's working! – Phelype Oleinik Jan 27 '21 at 11:43
  • @ Phelype Oleinik. It was asked before so I tried not making duplicate question. link – Kasra Jan 27 '21 at 16:05
0

For MikTeX under Linux (Ubuntu), all that is required to

  1. sudo miktex-console

  2. Choose Switch to MiKTeX administrator mode

  3. Choose Check for updates under Updates.

MiKTeX will automatically install l3backend and other missing packages when needed.

tinlyx
  • 153