[SOLVED] man and the paths where man looks for manuals.
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi:
If I do 'man mplayer' I get 'No manual entry for mplayer'. If I do 'less /usr/local/share/man/man1/mplayer.1' or 'man /usr/local/share/man/man1/mplayer.1' then the manual is displayed in a perfectly readable form. I don't understand because, in /usr/lib/man.conf I have the line
MANPATH /usr/local/share/man/man1
Could somebody give me a clue on this mystery? Thanks.
What is the value of $MANPATH when you are at a command prompt? echo $MANPATH will show.
In Linux you don't have to explicitly set MANPATH - man will use the config file if it isn't set.
However, on CentOS it is in /etc/man.config rather than the one the OP mentioned. Not sure if the man page there says differently. On CentOS it says:
Quote:
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 /etc/man.config. The MANPATH statements in the configuration file identify particular directories to include in the search path.
In Slackware $MANPATH is set in /etc/profile and extended from the various config files in /etc/profile.d/*.
So the OP can unset $MANPATH and use /usr/lib/man.conf, or add /usr/local/share/man in the MANPATH definition in /etc/profile.
It is
/usr/local/man:/usr/man:/usr/lib/java/man:/usr/share/texmf/man
Aha! That doesn't include the necessary /usr/local/share/man. Assuming you are using bash, have a look at /etc/profile, /etc/profile.d/*.sh, ~/bashrc, ~/.bash_profile, ~/.bash_login, and ~/.profile (only the first two are created during installation, later ones may not exist) and you will hopefully find where MANPATH is being set and can adjust accordingly.
Aha! That doesn't include the necessary /usr/local/share/man. Assuming you are using bash, have a look at /etc/profile, /etc/profile.d/*.sh, ~/bashrc, ~/.bash_profile, ~/.bash_login, and ~/.profile (only the first two are created during installation, later ones may not exist) and you will hopefully find where MANPATH is being set and can adjust accordingly.
Well, it is in /usr/lib/man.conf and, there, I have removed MANPATH /usr/local/share/man/man1
and left only
MANPATH /usr/local/share/man
(among other MANPATH's).
But it's just the same. The problem is mplayer doesn't belong to the distro. It was compiled and installed by me from source. That is, I think this might be the problem.
To everybody else: I think I now have enough material to work with. I'll set to work and let you know. Thanks.
In Slackware $MANPATH is set in /etc/profile and extended from the various config files in /etc/profile.d/*.
So the OP can unset $MANPATH and use /usr/lib/man.conf, or add /usr/local/share/man in the MANPATH definition in /etc/profile.
If I unset MANPATH then I see man reads /usr/lib/man.conf (because 'man mplayer' gets the manual) and, if I insert 'MANPATH /usr/local/share/man' in /etc/profile this, works too. But I cannot understand why, in spite of the remarks heading /usr/lib/man.conf, man does not read /usr/lib/man.conf. Because obviously it does not read it unless I unset MANPATH. That is, long before I installed mplayer, /usr/lib/man.conf must have been there, from the time I installed slackware. But what is the purpose of that file if the only way for the system to use it is to unset MANPATH?
Thanks a lot, bathory.
man reads /usr/lib/man.conf, but the MANPATH variable is overwritten by the value of MANPATH at /etc/profile. Quote from /usr/lib/man.conf:
Quote:
# This file is read by man to configure the default manpath (also used
# when MANPATH contains an empty substring), to find out where the cat
# pages corresponding to given man pages should be stored,
# and to map each PATH element to a manpath element.
man reads /usr/lib/man.conf, but the MANPATH variable is overwritten by the value of MANPATH at /etc/profile. Quote from /usr/lib/man.conf:
I see: in /etc/profile I see:
export MANPATH=/usr/local/man:/usr/man
I'll reboot and carefully write down the value of MANPATH, because I see in /usr/lib/man.conf I have several MANPATH sentences. Good bye.
Hi again:
reading man man, I now see there are at least two solutions to the problem. One is to use
MANPATH_MAP bynary_path manual_path.
The other is to unset MANPATH in /etc/profile, perhaps simply by removing the statement MANPATH=.
Still another one would be to mkdir a subdir in the dir which contains the binary and place the manual there, but to do this I have to have AUTOPATH enabled in man.conf, which whould man waste time. And of course, like bathory said, I could enlarge the MANPATH variable in /etc/profile inserting the required path into it.
When I have decided in favor of one of these and seen that it works, I'll post it here in case some linux newbie like me finds it helpful.
Cheers.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.