LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   man finds it, but man -k or apropos doesn't: why? (https://www.linuxquestions.org/questions/linux-software-2/man-finds-it-but-man-k-or-apropos-doesnt-why-929598/)

mcswell 02-15-2012 10:14 PM

man finds it, but man -k or apropos doesn't: why?
 
I have a man page here:
/groups/tools/texlive/2011/texmf/doc/man/man1/otfinfo.1
The directory is on my $MANPATH, and the 'man' program finds it. That is, if I type
man otfinfo
then I get the man page for otfinfo. But neither 'man -k' nor 'apropos' finds it, i.e.
apropos otfinfo
doesn't work, nor does
apropos font
even though the word "font" appears in the 'NAME' section of that manpage. ('apropos font' finds a ton of other stuff, but not this.)

I thought I'd try explicitly telling 'man -k' where to look:
man -k -M /groups/tools/texlive/2011/texmf/doc/man/man1/ \
otfinfo
but it still doesn't find anything. I tried /usr/bin/apropos with the -M option, but our version of 'apropos' (RedHat distro, unlike the one here: http://www.dsm.fordham.edu/cgi-bin/m...?topic=apropos) doesn't support the -M option.

'file' (and inspection) shows the otfinfo.1 file to be "troff or preprocessor input text." So it's not some funny format.

Why can 'man' find this manpage, but 'man -k' can't?

tommylovell 02-15-2012 10:22 PM

'apropos' and 'man -k' use a database that is created/updated by 'makewhatis' (or 'mandb' in newer releases).

Usually one of those commands is run from cron periodically to update the database. If the man page in question was newly added to your system, try running 'makewhatis' (or 'mandb') and see if that helps.

mcswell 02-16-2012 07:51 AM

Thanks!

Our system doesn't have mandb, and for some reason makewhatis is not executable by me. I'll check with our IT people about whether that's intentional. In the case of this man file, it's on my $MANPATH, but not the system $MANPATH. So I'll probably also need to get our IT people to add that path.

From what I can tell from the various man pages on 'makewhatis', 'man' etc., the indexes are maintained in global (system) directories. It doesn't look like there's any provision for adding indices under ~, is that correct? I.e. I can't add personal man pages to the index that 'apropos' would find.

tommylovell 02-16-2012 05:16 PM

Quote:

Originally Posted by mcswell (Post 4604066)
Our system doesn't have mandb, and for some reason makewhatis is not executable by me. I'll check with our IT people about whether that's intentional.

It's probably intentional. 'mandb' in my case is executable by an non-priivileged user, me, but I apparently don't have access to all the files mandb accesses.
Code:

[tommy@athlon ~]$ whereis mandb
mandb: /usr/bin/mandb /usr/share/man/man8/mandb.8.gz
[tommy@athlon ~]$ ll /usr/bin/mandb
-rwxr-xr-x. 1 root root 117112 Jun 17  2011 /usr/bin/mandb
[tommy@athlon ~]$ mandb
Purging old database entries in /usr/share/man...
Processing manual pages under /usr/share/man...
fopen: Permission denied
[tommy@athlon ~]$

Quote:

In the case of this man file, it's on my $MANPATH, but not the system $MANPATH. So I'll probably also need to get our IT people to add that path.
Or they may prefer to copy it into their own protected directory...

Quote:

It doesn't look like there's any provision for adding indices under ~, is that correct? I.e. I can't add personal man pages to the index that 'apropos' would find.
That's correct. It's pretty much up to your system admins to add your man pages in if they decide that's appropriate...


All times are GMT -5. The time now is 02:11 PM.