LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This 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

Reply
 
Search this Thread
Old 06-09-2010, 01:01 PM   #1
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 3,268

Rep: Reputation: 49
man and the paths where man looks for manuals.


GNU/linux kernel 2.6, Slackware 12.0
man 1.6c

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.
 
Old 06-09-2010, 01:23 PM   #2
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,563
Blog Entries: 29

Rep: Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179
What is the value of $MANPATH when you are at a command prompt? echo $MANPATH will show.
 
Old 06-09-2010, 01:31 PM   #3
MensaWater
Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,028
Blog Entries: 5

Rep: Reputation: 791Reputation: 791Reputation: 791Reputation: 791Reputation: 791Reputation: 791Reputation: 791
It should only be:

Code:
MANPATH /usr/local/share/man
That is to say, leave off the man1
 
Old 06-09-2010, 01:35 PM   #4
MensaWater
Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,028
Blog Entries: 5

Rep: Reputation: 791Reputation: 791Reputation: 791Reputation: 791Reputation: 791Reputation: 791Reputation: 791
Quote:
Originally Posted by catkin View Post
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.
 
Old 06-09-2010, 01:39 PM   #5
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,971

Rep: Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343
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.
 
1 members found this post helpful.
Old 06-09-2010, 01:47 PM   #6
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 3,268

Original Poster
Rep: Reputation: 49
Quote:
Originally Posted by catkin View Post
What is the value of $MANPATH when you are at a command prompt? echo $MANPATH will show.
It is
/usr/local/man:/usr/man:/usr/lib/java/man:/usr/share/texmf/man

Thanks for your kind post, katkin.
 
Old 06-09-2010, 01:55 PM   #7
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 3,268

Original Poster
Rep: Reputation: 49
Thanks, thanks, thanks.

Thanks everybody who replied. If I want to test if man now sees the page should I reboot the machine or can I do it somehow else?
 
Old 06-09-2010, 01:59 PM   #8
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,563
Blog Entries: 29

Rep: Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179
Quote:
Originally Posted by stf92 View Post
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.
 
Old 06-09-2010, 02:07 PM   #9
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,971

Rep: Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343
Quote:
If I want to test if man now sees the page should I reboot the machine or can I do it somehow else?
You can run either
Code:
unset MANPATH
to use /usr/lib/man.conf, or
Code:
export MANPATH=/usr/local/share/man:$MANPATH
and check.
 
1 members found this post helpful.
Old 06-09-2010, 02:09 PM   #10
MensaWater
Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,028
Blog Entries: 5

Rep: Reputation: 791Reputation: 791Reputation: 791Reputation: 791Reputation: 791Reputation: 791Reputation: 791
It shouldn't require a reboot.

The way it is done on CentOS it doesn't require anything after you add it to the man.config.

On UNIX (and maybe Slackware?) it require re-sourcing the file (.bashrc, .profile or /etc/profile etc...) that contains the MANPATH= line.

You source a file but typing ". filename" note - the space between the dot and the filename. If it were say .bashrc it would be ". .bashrc".
 
1 members found this post helpful.
Old 06-09-2010, 02:14 PM   #11
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 3,268

Original Poster
Rep: Reputation: 49
Quote:
Originally Posted by catkin View Post
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.

Last edited by stf92; 06-09-2010 at 02:16 PM.
 
Old 06-09-2010, 03:04 PM   #12
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 3,268

Original Poster
Rep: Reputation: 49
Quote:
Originally Posted by bathory View Post
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.
 
Old 06-09-2010, 03:16 PM   #13
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,971

Rep: Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343
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.
 
1 members found this post helpful.
Old 06-09-2010, 03:50 PM   #14
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 3,268

Original Poster
Rep: Reputation: 49
Quote:
Originally Posted by bathory View Post
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.
 
Old 06-09-2010, 04:30 PM   #15
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 3,268

Original Poster
Rep: Reputation: 49
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.

Last edited by stf92; 06-09-2010 at 04:36 PM.
 
  


Reply

Tags
man


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
find: paths must precede expression -- already checked google/man/faqs escalf Programming 5 03-02-2010 11:12 AM
waht file have paths for man? man.conf? where? xcore_on Linux - Newbie 4 05-23-2006 10:38 AM
man alsamixer not showing the man page nosaku Slackware 1 12-20-2004 09:52 AM
How to quit man (less) and keep man info on screen? peb Linux - Newbie 7 03-25-2004 11:02 PM
Compiling packages on RH 7.1 causes man files to be named man.gz mmboam Linux - General 0 05-09-2001 07:47 PM


All times are GMT -5. The time now is 09:28 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration