Can't find man pages

When using the command line interface, my new PowerBook G4 running 10.4.2 can't find any manual entries for the man command. For example, if I type "man ls", it returns the following: No manual entry for ls. Anyone have any idea what is wrong?

Posted on Sep 14, 2005 4:34 PM

Reply
13 replies

Sep 14, 2005 6:14 PM in response to Scott Stagg

Scott

Well, maybe that's your problem! On my 10.4.2 I get:

$ cd /usr/man
bash: cd: /usr/man: No such file or directory

but I do have a "/usr/X11R6/man".

The important directory you are missing is "/usr/share/man" ("/usr/local/share/man" doesn't exist on my machine either).

I don't know why you have this problem, unless you've installed something that meddles with MANPATH. But you can get around it as follows:

echo 'export MANPATH=$MANPATH:/usr/share/man/' >> ~/.bash_profile

Then you will need to restart Terminal for this to have an effect: check again with echo $MANPATH. Of course, if you're using a shell other than bash, you will need to modify accordingly.

Sep 15, 2005 11:02 AM in response to Michael Conniff

Ahh, this is helpful. When I manually set the MANPATH, man works again. However, what I'd like to do is make the change globally so every user on the machine doesn't have to modify their .cshrc ( or .profile ). Another thing I've discovered is that the problem is only in X11. If I launch "Terminal" and try using man, it works with no problems. So there must be something wrong with my /etc/X11/xinit file, but I'm nervous about mucking around with that file. I know man worked with X11 in OS 10.3. Do you know if something has changed? Do you have any recommendations?

Thanks a bunch.

Sep 15, 2005 1:10 PM in response to Scott Stagg

Scott

OK, that fix will work whenever you start bash as a login shell. You can make it work for non-login shells by

echo 'export MANPATH=$MANPATH:/usr/share/man/' >> ~/.bashrc
echo 'source ~/.bashrc' >| ~/.bash_profile

But if you want to make it global, you would use

echo 'export MANPATH=$MANPATH:/usr/share/man/' >> /etc/bashrc

This relies on the fact the the "/etc/profile" as shipped, will source the "/etc/bashrc" file. Note there is no leading period on these two files.

I'm afraid I am very rusty on X11. You will almost certainly get some answers if you post in the UNIX forum.

Sep 15, 2005 1:19 PM in response to Michael Conniff

I hate to contradict a level 4, but I disagree with manually setting MANPATH.

I don't have anything set in my MANPATH and man works just great. From the manual page for man itself:

"If you don't specify -M but set the MANPATH environment variable, the
value of that variable is the list of the directories that man
searches.

If you don't specify an explicit path list with -M or MANPATH, man
develops its own path list based on the contents of the configuration
file /usr/share/misc/man.conf. The MANPATH statements in the configu-
ration file identify particular directories to include in the search
path.

Furthermore, the MANPATH_MAP statements add to the search path depend-
ing on your command search path (i.e. your PATH environment variable).
For each directory that may be in the command search path, a MAN-
PATH_MAP statement specifies a directory that should be added to the search path for manual page files. man looks at the PATH variable and
adds the corresponding directories to the manual page file search path.
Thus, with the proper use of MANPATH_MAP, when you issue the command
man xyz, you get a manual page for the program that would run if you
issued the command xyz."

What does that mean? man configures manpath on its own by looking at 2 things: /usr/share/misc/man.conf and your PATH. Rather than having to manually maintain MANPATH, just unset it and let it take care of itself. Unless you're putting man pages in a weird place, everything just works.

Sep 15, 2005 1:39 PM in response to Michael Conniff

Michael, I'd check (in this order):
/etc/profile
~/.bash_profile
~/.bash_login
~/.profile
~/.bashrc

And if those files source any other files, check those.

You could do:
grep MANPATH /etc/profile
grep MANPATH ~/.bash_profile
grep MANPATH ~/.bash_login
grep MANPATH ~/.profile
grep MANPATH ~/.bashrc

remove any instances where MANPATH is being explicitly set in these files, then if that doesn't correct it, go through again and grep for "source", then taking the argument to source (filename) and grepping for MANPATH.

Alot of work, I agree, but you'll end up with a cleaner, simpler to maintain system in the end.

Edit: and looking at my /etc/profile, it sources /etc/bashrc (but not using "source", as I'd expect). Therefore, I'd add /etc/bashrc to the list, and also change the part where you're looking for other included files. You might have to go through each file by hand, looking for any other file references.

Sep 16, 2005 11:28 AM in response to Jeff Hubbach

Jeff

Thanks for posting that, but you should have addressed it to Scott, not me!

Also, note what Scott said in post 1.1.1.1:

" Another thing I've discovered is that the problem is only in X11"

So I would think Scott wouldn't find much in those files you listed (many of which may well not exist). I told him my X11 was rusty, so if you have an equivalent list of X11 files, why don't you post that?

Sep 16, 2005 12:10 PM in response to Michael Conniff

The only difference between X11 xterm sessions and Apple Terminal sessions is that one opens a login shell (X11's xterm), and the other does not (Apple's Terminal).

What does that mean? A login shell (X11 xterm) will read, in this order:
/etc/profile
~/.bash_profile
~/.bash_login
~/.profile

A non-login shell (Apple Terminal), will read, in this order:
~/.bashrc

So, if you want all shells to behave the same, do the following:
Put all your aliases, PATH stuff, etc that you don't want system-wide into ~/.bashrc. Don't put anything in .profile or .bash_login, and in .bash_profile, have one line:
source .bashrc


Now all terminals will behave the same. X11's xterm and Apple's Terminal.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Can't find man pages

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.