TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

On a fresh install of TeXlive on a Linux box (Linux Mint 11) I get the following error message:

! LaTeX Error: File `scalefnt.sty' not found.

But the file is there:

$ find /usr/ -name 'scalefnt.sty'  -print

Why pdflatex did not find it? Is it a bug in the TeXLive installation process?

Until now I have solved this problem by adding lines like this one :

export TEXINPUTS=$TEXINPUTS:/usr/share/texmf-texlive/tex/latex/carlisle/

in my .bashrc file. Now I have 20+ such lines in my .bashrc. There must be a better way to solve this problem.

-- Update -- Running texhash did not solve the problem.

$ sudo texhash
[sudo] password :
texhash: Updating /usr/local/share/texmf/ls-R... 
texhash: Updating /var/lib/texmf/ls-R-TEXMFMAIN... 
texhash: Updating /var/lib/texmf/ls-R-TEXLIVE... 
texhash: Updating /var/lib/texmf/ls-R... 
texhash: Done.

I think the ls-R file in /usr/local/share/ was created by texhash. It is empty. I found in the kpathsea doc how to log : export TEXMFLOG=/tmp/texmf.log. After running pdflatex I get in the log :

$ cat /tmp/texmf.log 
1309254390 /var/lib/texmf/ls-R
1309254390 /usr/local/share/texmf/ls-R
1309254390 /usr/share/texmf/ls-R
1309254390 /usr/share/texmf-texlive/ls-R
1309254390 /var/lib/texmf/web2c/pdftex/pdflatex.fmt
1309254390 /usr/share/texmf-texlive/tex/latex/base/letter.cls
1309254390 /usr/share/texmf-texlive/tex/latex/base/letter.cls
1309254390 /usr/share/texmf-texlive/tex/latex/base/size10.clo
1309254390 /usr/share/texmf-texlive/tex/latex/base/size10.clo
1309254390 /usr/share/texmf-texlive/tex/generic/babel/babel.sty
1309254390 /usr/share/texmf-texlive/tex/generic/babel/babel.sty
1309254390 /usr/share/texmf-texlive/tex/generic/babel/frenchb.ldf
1309254390 /usr/share/texmf-texlive/tex/generic/babel/frenchb.ldf
1309254390 /usr/share/texmf-texlive/tex/generic/babel/babel.def
1309254390 /usr/share/texmf-texlive/tex/generic/babel/frenchb.cfg
1309254390 /usr/share/texmf-texlive/tex/generic/babel/frenchb.cfg 

In the texlive setup I use, the files /usr/share/texmf/ls-R and /usr/share/texmf-texlive/ls-R are links to /var/lib/texmf/ls-R-TEXMFMAIN and /var/lib/texmf/ls-R-TEXLIVE respectively.

I don't understand why it does not work since the style file is in one of the ls-R files:

$ grep scalefnt.sty /var/lib/texmf/ls-R-TEXLIVE

This looks like a bug in the texlive package installation process (in Linux Mint/Ubuntu).

share|improve this question
You definitely shouldn't need all those modifications to $TEXINPUTS. Have you tried running mktexlsr (texhash)? You should be able to do sudo texhash or sudo mktexlsr to rebuild the list of files. Does that solve the problem? – Alan Munn Jun 27 '11 at 15:59
I met the same problem. But I occasionally found it in my case that I have to change the file permissions for .sty files. This could be the answer. – Yin Aug 24 '12 at 21:12
I know this is an old thread, but I have just run into what looks like the same problem after doing a clean install of Ubuntu 12.04 and then installing texlive via apt-get. In my case it cannot find 'article.cls' but on running 'sudo latex test.tex' it works – Yemon Choi May 2 '13 at 1:49

Modern TeX distributions use kpathsea library to find the files.

If your TeX Live cannot find the file, try to run texhash to refresh the file name database. On Linux / Mac, run sudo texhash.

share|improve this answer
Thanks to Alan & Leo. I tried both sudo texhash and sudo mktexlsr. I get the following output: mktexlsr: Updating /usr/local/share/texmf/ls-R... 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. But I continue to get the same error. – Davy_Crockett Jun 27 '11 at 22:15
@Davy_Crockett: It seems that you installed two TeX Live distributions: one is from Linux source (at /usr/share/), the other one is from TUG (at /usr/local/share/). You don't have scalefnt.sty in the TUG one (usr/local/share/...). Or maybe you wrongly installed TeX Live. – Leo Liu Jun 28 '11 at 0:06
I updated the question because it did not fit in a comment. – Davy_Crockett Jun 28 '11 at 10:13
sudo texhash did the trick for me. Thanks for the tip! – user7823 Sep 13 '11 at 9:15
@Boris: I converted your answer to a comment. Instead of posting a “Thank you” as an additional answer, you should thank Leo by upvoting his answer (with the upward pointing arrow to the left of it; you need 15 reputation points before you can upvote). We want to keep the answer space reserved for actual answers. – Stefan Kottwitz Sep 13 '11 at 13:32

What happened to me was: in Ubuntu 11.10 I defined the environment variable TEXMFCN to point at my home directory



For some reason, after the upgrade to 14.04, the bash gave a different interpretation to my setting: to search the latex packages only in my home directory. So, commenting that line in .bashrc

# $TEXMFCNF=$HOME/texmf/web2c

# export TEXMFCNF

worked out for me. Defining the variable by including the paths to all the existing files texmf.cfn



also works.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.