# fontspec cannot find fonts on Ubuntu

I recently migrated to Ubuntu from Mac OS. I installed TexLive and it works. However, fontspec doesn't work, no matter what fonts I use. This goes for fonts native to Ubuntu and fonts that I have installed in ~/.fonts/ myself. I know that these fonts are installed, because I can use them in LibreOffice, including those that I have installed myself. However, if I load fontspec, I invariably get the error:

*************************************************
* LaTeX warning: "xparse/redefine-command"
*
* Redefining document command \oldstylenums with arg. spec. 'm' on line 128.
*************************************************
) (/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty
(/usr/share/texlive/texmf-dist/tex/latex/base/fontenc.sty
(/usr/share/texlive/texmf-dist/tex/latex/euenc/eu1enc.def)
(/usr/share/texlive/texmf-dist/tex/latex/euenc/eu1lmr.fd)kpathsea:make_tex:     Invalid fontname [lmroman10-regular]', contains '['

! Font EU1/lmr/m/n/10=[lmroman10-regular]:mapping=tex-text at 10.0pt not loadab
relax
l.100 \fontencoding\encodingdefault\selectfont


A M(non)WE is:

\documentclass[utf8,12pt,letterpaper]{article}
\usepackage{fontspec}
\setmainfont[Ligatures={Common,TeX},Contextuals=NoAlternate]{DejaVuSerif.ttf}
\begin{document}
test
\end{document}


I compile in xelatex (this is necessary since I will want to use CJK).

I've googled and googled and reinstalled TexLive several times, rebooted the system, etc. I'm out of ideas. All help greatly appreciated!

• You have a faulty or incomplete TeX Live installation, because you're missing the Latin Modern fonts in OpenType format. Did you install TeX Live with the Debian/Ubuntu methods or the “vanilla” one? Mar 30 '14 at 23:19
• honestly, it's hard to tell at this point, since I installed and uninstalled so many times. if you could tell me how I can wipe the installation clean and install it again I would be very grateful. I need a lot of language packages so I guess a full install would be best? Mar 31 '14 at 0:35
• solved it. please change your comment to an answer and I will label the question resolved. Thank you! Mar 31 '14 at 2:20
• Mar 31 '14 at 17:07

Your TeX Live installation is faulty or incomplete. It misses the Latin Modern fonts in OpenType format which are necessary for fontspec to work, because they are the “fallback fonts”.

If you have the “vanilla” TeX Live, use tlmgr to install/reinstall

collection-fontsrecommended


(or just the lm package). For a TeX Live/Debian, use apt-get to install all “recommended” packages.

In any case, a full install is preferable than adjusting it when things go wrong. Within TeX Live/Debian it's always difficult to understand what Debian package contains what we need.

This worked for me:

sudo apt-get install lmodern
`
• FYI, this solution worked for me when using Debian 8 (Jessie). Oct 4 '21 at 19:06