tlmgr update texhash

Martin Münch Martin.Muench at
Sat Mar 25 12:45:10 CET 2023


yes, was looking for texhas, but mktexlsr is done. _Should_ be 
sufficient. The note about the failed update did not reach the user. 
Maybe "tlmgr update --all" >>finished<< and closed its window instead of 
stopping? Or the error message was not shown? Or the error message was just

/home/<username>/.texlive/texmf-config/ls-R: no write permission, 

instead of

FAILED to update /home/<username>/.texlive/texmf-config/ls-R
Writing to that file was not permitted.
You MUST fixed the permissions and then re-run "mktexlsr"!

- and stopping there and not closing the window and waiting for the user 
to confirm that they have read and understood the message and promise to 
fix the problem.

The communication was like this:

I would like to report a (possible) regression in version
"2023-03-07 v2.0a" of the package (also indicated with ID
66465 by tlmgr), where a .tex file would stop to compile
on my system, despite working with the previous version
(60414) of the same package.



latex test.tex
latex test.tex

rm -f test.aux
rm -f test.fdb_latexmk
rm -f test.fls
rm -f test.log



\rfoot{page \thepage/\pageref{LastPage}}

\includepdfset{offset=-10.25cm 0cm}

\begin{center}Lorem ipsum\end{center}\end{singlespace}



This is pdfTeX, Version 3.141592653-2.6-1.40.24 (TeX Live 2022) 
(preloaded format=latex)
  restricted \write18 enabled.
entering extended mode
LaTeX2e <2022-11-01> patch level 1
L3 programming layer <2023-02-22>
Document Class: article 2022/07/02 v1.4n Standard LaTeX document class

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

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

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

l.67 \endinput
No pages of output.
Transcript written on test.log.


The new lastpage version produced

 > (/home/<username>/.texlive/texmf-dist/tex/latex/lastpage/lastpage.sty
 > ! LaTeX Error: File `lastpage2e.sty' not found.

In the directory
there should be

File name                  Size
-----------------------    -----
lastpage.sty               2,820
lastpage209.sty            2,869
lastpage2e.sty             2,668
lastpageclassic.sty        9,347
lastpagemodern.sty         9,016

total files 5    total size 26,720

If any of those is missing, they are included in
(at least they should be, otherwise something went wrong and I need to 
check that).

If they are there, LaTeX did not find them.
Try running
to update the file data base (or whatever your TeX distribution uses for 

In the directory
there now should be a large file "ls-R", which contains also an entry

 > ./tex/latex/lastpage:
 > lastpage.sty
 > lastpage209.sty
 > lastpage2e.sty
 > lastpageclassic.sty
 > lastpagemodern.sty

With the files in 
/home/<username>/.texlive/texmf-dist/tex/latex/lastpage/ and the entries 
in /home/<username>/.texlive/texmf-dist/ls-R
does the error still occur?

lastpage.sty should load lastpage2e.sty, which should load 
lastpagemodern.sty on your recent system, obviously it did not. 
Therefore you could also say \usepackage{lastpagemodern}, but
- if lastpage2e.sty is not found, lastpagemodern probably will not be 
found either
- if you gave the document to someone with an older distribution, 
loading lastpagemodern would not work but lastpageclassic would be needed.


<username> wrote:

 > In the directory
 > /home/<username>/.texlive/texmf-dist/tex/latex/lastpage/
 > there should be

Here is the content of the directory after updating to the latest
version of "lastpage" with tlmgr:

     $ ls -l /home/<username>/.texlive/texmf-dist/tex/latex/lastpage/
     -rw-r--r-- 1 <username> <username> 2869 mar  7 10:50 lastpage209.sty
     -rw-r--r-- 1 <username> <username> 2668 mar  7 10:50 lastpage2e.sty
     -rw-r--r-- 1 <username> <username> 9347 mar  7 10:50 
     -rw-r--r-- 1 <username> <username> 9016 mar  7 10:50 lastpagemodern.sty
     -rw-r--r-- 1 <username> <username> 2820 mar  7 10:50 lastpage.sty

which match exactly the expected file names and sizes reported
in your mail.

 > Try running texhash or mktexlsr

I tried that and got the following:

     $ texhash
     texhash: /home/<username>/.texlive/texmf-config/ls-R: no write 
permission, skipping...
     texhash: /home/<username>/.texlive/texmf-dist/ls-R: no write 
permission, skipping...
     texhash: /home/<username>/.texlive/texmf-local/ls-R: no write 
permission, skipping...
     texhash: Updating /home/<username>/.texlive/texmf-var/ls-R...
     texhash: Done.

Which lead me to the discovery that the "ls-R" files
had the wrong permissions!
I then fixed the permissions, and re-ran both "texhash" and "mktexlsr".


Now compilation succeeds even with latest "lastpage" package version!

I am not sure why the warnings were not shown when running
"tlmgr update --all". Maybe they were hidden and ignored somehow.
Otherwise, is it possible that "texhash"/"mktexlsr" were not
triggered automatically for some reason?


On 16.03.2023 23:52:15, Norbert Preining wrote:
> Hi
>> tlmgr update --self --all --reinstall-forcibly-removed -repository
>> <somewhere>
>> I get updates and new packages (if TeX Live is not frozen) and messages
>> about their installation.
>> I do not remember seeing any messages about updates of "ls-R"-files at the
>> end of those messages.
> There is. The first thing after the updates are done, here an example
> with only a single update:
> ++++++++++++++
> [1/1, ??:??/??:??] update: japanese-otf-nonfree [38k] (360 -> 368 at tlcontrib) ... done
> running mktexlsr ...
> done running mktexlsr.
> +++++++++++++
> Maybe you are looking for "texhash" which should anyway not be used. Use
> mktexlsr.
>> Now this happened: I updated a package and had to increase the number of
>> included .sty files. It is at CTAN, and in the repositories, and users do
>> tlmgr update, and:
>> Expected: TeX Live finds all of those files.
>> Seen by user: Error, file not found.
> Not enough information.
>> Running texhash manually by the user said:
>> texhash: /home/<username>/.texlive/texmf-config/ls-R: no write permission,
>> skipping...
>> texhash: /home/<username>/.texlive/texmf-dist/ls-R: no write permission,
>> skipping...
>> texhash: /home/<username>/.texlive/texmf-local/ls-R: no write permission,
>> skipping...
>> texhash: Updating /home/frazar/.texlive/texmf-var/ls-R...
>> texhash: Done.
> Irrelevant. Files installed by tlmgr are NOT installed into $TEXMFLOCAL
>> After removing the write protection and running texhash again, the .sty
>> files are found. Problem for that user solved.
> Sounds rather cryptic.
>> - Does "tlmgr update" internally try to update the ls-R-files and fails? It
>> should inform the user about this failure!
> If it fails, it warns about it.
> But tlmgr does NOT update local user files (the ones listed above).
>> - Does "tlmgr update" not even try to update the ls-R-files (for packages
>> which are updated vs. packages which are newly installed)? It should inform
> No. I t *does* of course update the ls-R files, otherwise it would be
> broken.
>> While I run texhash regularly anyway because of changes in my
>> ./tex/latex/local, that is probably not the case for an average user.
> You should NOT run texhash/mktexlsr on $TEXMFHOME and remove the ls-R
> file there.
> Best
> Norbert
> --
> PREINING Norbert                    
> Mercari Inc.     +     IFMGA Guide     +     TU Wien     +     TeX Live
> GPG: 0x860CDC13   fp: F7D8 A928 26E3 16A1 9FA0 ACF0 6CAC A448 860C DC13

More information about the tex-live mailing list.