2

Since i upgraded my Ubuntu system to 18.04, texdoc fails to find anything.

In the process of my experiments, trying to make it work, the symptoms changes: first it complained that it could not find some PDF file, and the file indeed was not there, but then i installed (or reinstalled, i do not remember) the package with the missing file, and now texdoc replies to everything with "Sorry, no documentation found for ...":

§ texdoc algorithmicx
Sorry, no documentation found for algorithmicx.
If you are unsure about the name, try searching CTAN's TeX catalogue at
http://ctan.org/search.html#byDescription.
§ ls /usr/share/texlive/texmf-dist/doc/latex/algorithmicx/
algorithmicx.pdf  algorithmicx.tex.gz  README
§ apt list "texlive-science*"
Listing... Done
texlive-science/bionic,bionic,now 2017.20180305-2 all [installed]
texlive-science-doc/bionic,bionic,now 2017.20180305-2 all [installed]
§ texdoc -d algorithmicx
texdoc debug-version: /usr/share/texlive/texmf-dist/scripts/texdoc/texdoclib.tlu version 2.0171
texdoc debug-config: Setting 'debug_list=all' from command line option "-d".
texdoc debug-config: Setting 'viewer_pdf=(xdg-open %s) &' in file "/usr/share/texlive/texmf-dist/texdoc/texdoc.cnf" on line 37.
texdoc debug-config: Setting 'viewer_ps=(xdg-open %s) &' in file "/usr/share/texlive/texmf-dist/texdoc/texdoc.cnf" on line 38.
texdoc debug-config: Setting 'viewer_dvi=(xdg-open %s) &' in file "/usr/share/texlive/texmf-dist/texdoc/texdoc.cnf" on line 39.
texdoc debug-config: Setting 'viewer_html=(xdg-open %s) &' in file "/usr/share/texlive/texmf-dist/texdoc/texdoc.cnf" on line 40.
texdoc debug-config: Setting 'viewer_txt=(xdg-open %s) &' in file "/usr/share/texlive/texmf-dist/texdoc/texdoc.cnf" on line 41.
texdoc debug-config: Setting 'zipext_list=gz, bz2, xz' in file "/usr/share/texlive/texmf-dist/texdoc/texdoc.cnf" on line 70.
texdoc debug-config: Setting 'unzip_gz=gzip -d -c' in file "/usr/share/texlive/texmf-dist/texdoc/texdoc.cnf" on line 71.
texdoc debug-config: Setting 'unzip_bz2=bzip2 -d -c' in file "/usr/share/texlive/texmf-dist/texdoc/texdoc.cnf" on line 72.
texdoc debug-config: Setting 'unzip_xz=xz --decompress --stdout' in file "/usr/share/texlive/texmf-dist/texdoc/texdoc.cnf" on line 73.
texdoc debug-config: Setting 'suffix_list=doc, -doc, _doc, .doc, /doc, manual, /manual, -manual, userguide, /user_guide, -guide, -user, -man, notes, -info, ref' in file "/usr/share/texlive/texmf-dist/texdoc/texdoc.cnf" on line 98.
texdoc debug-config: Setting 'lastfile_switch=true' in file "/usr/share/texlive/texmf-dist/texdoc/texdoc.cnf" on line 502.
texdoc debug-config: Setting 'lang=en' from operating system locale.
texdoc debug-config: Setting 'badext_list=txt, ' from built-in defaults.
texdoc debug-config: Setting 'basename_list=readme, 00readme' from built-in defaults.
texdoc debug-config: Setting 'ext_list=pdf, htm, html, txt, ps, dvi, ' from built-in defaults.
texdoc debug-config: Setting 'mode=view' from built-in defaults.
texdoc debug-config: Setting 'max_lines=20' from built-in defaults.
texdoc debug-config: Setting 'verbosity_level=2' from built-in defaults.
texdoc debug-config: Setting 'machine_switch=false' from built-in defaults.
texdoc debug-config: Setting 'badbasename_list=readme, 00readme' from built-in defaults.
texdoc debug-config: Setting 'interact_switch=true' from built-in defaults.
texdoc debug-config: Setting 'rm_dir=rmdir' from built-in defaults.
texdoc debug-config: Setting 'rm_file=rm -f' from built-in defaults.
texdoc debug-files: Configuration files are:
texdoc debug-files: active  /usr/share/texlive/texmf-dist/texdoc/texdoc.cnf
texdoc debug-texdocs: texdocs[8] = /home/alexey/.texlive2017/texmf-config/doc (index_mandatory=false, recursion_allowed=true)
texdoc debug-texdocs: texdocs[7] = /home/alexey/.texlive2017/texmf-var/doc (index_mandatory=false, recursion_allowed=true)
texdoc debug-texdocs: texdocs[6] = /home/alexey/texmf/doc (index_mandatory=false, recursion_allowed=true)
texdoc debug-texdocs: texdocs[5] = /usr/local/share/texmf/doc (index_mandatory=true, recursion_allowed=true)
texdoc debug-texdocs: texdocs[4] = /etc/texmf/doc (index_mandatory=false, recursion_allowed=true)
texdoc debug-texdocs: texdocs[3] = /var/lib/texmf/doc (index_mandatory=true, recursion_allowed=true)
texdoc debug-texdocs: texdocs[2] = /usr/share/texmf/doc (index_mandatory=true, recursion_allowed=true)
texdoc debug-texdocs: texdocs[2] using index: /usr/share/texmf (shift=doc/)
texdoc debug-texdocs: texdocs[1] = /usr/share/texlive/texmf-dist/doc (index_mandatory=true, recursion_allowed=true)
texdoc debug-texdocs: texdocs[1] using index: /usr/share/texlive/texmf-dist (shift=doc/)
texdoc debug-tlpdb: Using shipped tlpdb data.
Sorry, no documentation found for algorithmicx.
If you are unsure about the name, try searching CTAN's TeX catalogue at
http://ctan.org/search.html#byDescription.

It feels as if some database needed to be rebuilt, but i didn't find any instructions.

What can i do to repair texdoc?

3

To find documentation files, texdoc uses a variety of strategies, depending on the type of TeX Live installation (vanilla or apt packages), among other things. For non-vanilla installations, the Lua function kpse.find_file() is used, which is an interface for kpathsea, which is the LaTeX utility for locating files in the directory tree.

To check if the problem is caused by kpathsea, you can try kpsewhich -format "TeX system documentation" algorithmicx.pdf in the terminal. If that doesn't give any results, then the kpathsea database is out of date. It can be updated with sudo mktexlsr [path], in this case sudo mktexlsr /usr/share/texlive/texmf-dist (see also texdoc doesn’t search at $TEXMFHOME). After that, kpsewhich should be able to find the file, and consequently also texdoc should find it.

Note that it would be easier if apt made the call to mktexlsr for documentation packages, which apparently did not happen during the upgrade.

Disclaimer: I had the same problem as the OP and the above solution worked for me - however the search strategy of texdoc is rather complicated and the error may be somewhere else.

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.