man page only found after ran with root

6

When I try to run man page on my Red Hat as a normal user I get "No manual entry for zip" If I change to root run: "man zip" and then I get the man page and afterwards I see the same man page as I did with root. Is there some kind of man page generation process taking place when I run it for the first time with root?

I have checked the /usr/share/man/man1/ there seem to be all the man pages for tools I usually use cp, ls, zip etc. I have also set $MANPATH envvar, but still no help.

Am I doing something wrong or the configuration on Red Hats differs from that of other Linux distros?

7368616d696c

Posted 2012-09-04T12:41:41.377

Reputation: 81

Answers

2

The solution to this issue is to check whether then /usr/share/man/ permissions are correctly set. In my case the execute flag on all

/usr/share/man/

folders was removed, except for root.

$ ls -l /usr/share/man/ # check if it has the x flag set for others 

if x flag is not set, set it

$ chmod o+x /usr/share/man/*

of course you also want check if $MANPATH is correctly set as mention in an earlier answer.

7368616d696c

Posted 2012-09-04T12:41:41.377

Reputation: 81

+1. Only needed to add that execute permissions for others. Also, regarding that MANPATH variable, the manual says that the variable used only if it's been set. Sounds like it's not a requirement but can be set to override the default path. – Bhesh Gurung – 2014-06-23T15:40:07.773

2

My guess is that your MANPATH is set incorrectly.

To test this, first try unsetting it:

$ unset MANPATH
$ man zip

If my guess is right, then you will man will use its default path and find the man page.

Also try comparing the output of echo $MANPATH as normal user vs root user.

Doug Harris

Posted 2012-09-04T12:41:41.377

Reputation: 23 578

Thanks for answering, it definitely helped to troubleshoot. Actually the problem was incorrect permission on man directories. There was no execute flag. After setting correct flag I could read mans. Thank you. – 7368616d696c – 2012-09-04T14:16:27.350

@7368616d696c If that wasn't the answer you used to fix your problem, then don't accept it - either have the answerer add that to his question or post it yourself. – cutrightjm – 2012-09-04T17:17:44.057

As ekaj points out, you can add an answer to your own question. I think you have to wait a day or two to accept it. The benefit to explicitly adding your own answer is that if somebody in the future finds this question, your answer will be clearly marked as the solution and may help. – Doug Harris – 2012-09-05T12:51:29.247