4

Everytime I run man it returns an error as if no man page entries were installed. Here's an example:

% man man

No manual entry for man

However, I have installed the packages man-db and man-pages, yet it doesn't return a single entry. I have tried with many commands like man ls, and others.

Also, if i run whatis man, the following is returned:

man: nothing appropriate.

dr_
  • 28,763
  • 21
  • 89
  • 133
Thesevs
  • 87
  • 1
  • 12
  • `man --debug man` may output some useful information. – fra-san Aug 06 '21 at 13:50
  • `man -u man` should try to rebuild the cache. – Eduardo Trápani Aug 06 '21 at 13:53
  • I tried both, still it says `no manual entry for man`. – Thesevs Aug 06 '21 at 13:58
  • @fra-san, the output shows the configuration at /etc/man_db.conf. – Thesevs Aug 06 '21 at 14:01
  • `strace man man` and see what it tries to access and do, and what it dies on. Mine logs 884 actions. – Paul_Pedant Aug 06 '21 at 14:06
  • @Paul_Pedant it looks like it's looking up many directories and trying to open them. Finally it returns this: `+++ exited with 16 +++`. Many calls at readlink returns this error: `Invalid argument`. – Thesevs Aug 06 '21 at 14:11
  • @Procer.Scvtvlatvs If you feel you are not seeing anything useful in `--debug`'s output you may want to share it here as a pastebin, so that others may help you dig into your issue. – fra-san Aug 06 '21 at 14:27
  • @fra-san Thanks for the suggestion. The following paste is that of [man --debug man](https://pastebin.com/maZ1HaiS) – Thesevs Aug 06 '21 at 14:51
  • @Paul_Pedant The following paste is that of [strace man man](https://pastebin.com/tAfr3VrV). – Thesevs Aug 06 '21 at 14:53
  • 1
    @Procer.Scvtvlatvs On a regular Arch, the fundamental man pages are installed in `/usr/share/man`. As expected, your `man` config lists that one among the directories to search, but then it doesn't add it to the search path, as if it wasn't readable. Oddly, `strace` shows that `man` doesn't even try to access it. I can't come up with any plausible explanation, unfortunately. – fra-san Aug 06 '21 at 15:22

1 Answers1

9

Once you install the packages man-db and man-pages you need to run the mandb command to generate the search database for manpage entries.

EDIT (thanks to @fra-san): If you set the MANPATH environment variable, you also need to unset it. If that variable is set, man ignores the paths specified in the config file man_db.conf.

dr_
  • 28,763
  • 21
  • 89
  • 133
  • 2
    Thank you very much, that solved it. I also had to `unset MANPATH` so that `mandb` could use the `man_db.conf` settings. – Thesevs Aug 06 '21 at 16:54
  • 1
    Adding the line `unset MANPATH` in my `.zshrc`, then `source ~/.zshrc` solved it for me too. Thank you! – kohane15 May 06 '22 at 08:28