6

I am trying to manually install the Latex formats provided by my university on my Linux machine with TeX Live. My TEXMFLOCAL folder is /usr/local/share/texmf. I copied the required files to subdirectories here. However, I am not able run mktexlsr here.

The following is what I tried:

mycomp:/usr/local/share/texmf # whoami
root
mycomp:/usr/local/share/texmf # mktexlsr
mktexlsr: Updating /etc/texmf/ls-R... 
/usr/lib/mktex/mktexlsr: line 184: /usr/local/share/texmf/ls-R: Permission denied
mktexlsr: could not create file '/usr/local/share/texmf/ls-R'. Skipping...
mktexlsr: Updating /var/lib/texmf/main/ls-R... 
mktexlsr: Updating /var/cache/texmf/fonts/ls-R... 
mktexlsr: Updating /var/lib/texmf/ls-R... 
mktexlsr: Done.

mycomp:/usr/local/share/texmf # touch ls-R
mycomp:/usr/local/share/texmf # ls -l
total 8
drwxrwxr-x 5 root root 4096 Apr 20 16:36 doc
-rw-r--r-- 1 root root    0 Apr 25 17:33 ls-R
drwxr-xr-x 3 root root 4096 Apr 20 16:36 tex

mycomp:/usr/local/share/texmf # mktexlsr
warning: kpathsea: /usr/local/share/texmf/ls-R: No usable entries in ls-R.
warning: kpathsea: See the manual for how to generate ls-R.
warning: kpathsea: /usr/local/share/texmf/ls-R: No usable entries in ls-R.
warning: kpathsea: See the manual for how to generate ls-R.
mktexlsr: Updating /etc/texmf/ls-R... 
mktexlsr: /usr/local/share/texmf/ls-R: no write permission, skipping...
mktexlsr: Updating /var/lib/texmf/main/ls-R... 
mktexlsr: Updating /var/cache/texmf/fonts/ls-R... 
mktexlsr: Updating /var/lib/texmf/ls-R... 
mktexlsr: Done.

What I am doing wrong here?

Edit:

The output of ls -ld is:

mycomp:/usr/local/share/texmf # ls -ld
drwxrwxr-x 4 root root 4096 Apr 25 17:33 .
1
  • 2
    Welcome to TeX.SX! What's the output of ls -ld /usr/local/share/texmf?
    – egreg
    Apr 25 '16 at 16:27
1

The problem is that your /usr/local/share/texmf belongs to group root, while it should be from mktex.

The documentation mentions setgid, but it is not set here:

ls -l /usr/bin/mktexlsr
lrwxrwxrwx 1 root root 21 Nov 19  2014 /usr/bin/mktexlsr -> /usr/lib/mktex/public

ls -l /usr/lib/mktex/public
-rwxr-xr-x 1 root mktex 11032 Oct 15  2014 /usr/lib/mktex/public

Let's hope that someone will find the explanation.

Meanwhile, here is how to solve the problem:

cd /usr/local/share/texmf/
# create ls-R if it does not exist yet
sudo touch ls-R
# change the ls-R group to mktex
sudo chgrp mktex ls-R
# change file mode bits (readable by all, writable by root and mktex group)
sudo chmod 664 ls-R

check:

ls -l /usr/local/share/texmf/ls-R 
-rw-rw-r-- 1 root mktex 246 Mar 13 11:39 /usr/local/share/texmf/ls-R

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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