[Tex/LaTex] Error: I can’t find the format file pdflatex.fmt

pdftex

For no particular reason that I could identify, I was faced with the impossibility to compile any latex document and invariably got this error message each time I tried :

LaTeX: problems after [0] pages

kpathsea: Running mktexfmt pdflatex.fmt
tcfmgr: config file `tcfmgr.map' (usually in $TEXMFMAIN/texconfig) not found.
I can't find the format file `pdflatex.fmt'!

Best Answer

I thought I would post this here because it gave me some cold sweats as I could not make any sense of the error message and have only two months remaining to write my thesis.

In a terminal, just type

sudo texconfig rehash

which should give

mktexlsr: Updating /var/lib/texmf/ls-R-TEXMFMAIN...
mktexlsr: Updating /var/lib/texmf/ls-R-TEXLIVE...
mktexlsr: Updating /var/lib/texmf/ls-R...
mktexlsr: Done.

This solution was found on this website.