LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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, 12:01 PM   #1
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Rep: Reputation: 76
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, 12:23 PM   #2
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

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

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
It should only be:

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

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
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, 12:39 PM   #5
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,165
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
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, 12:47 PM   #6
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76
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, 12:55 PM   #7
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76
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, 12:59 PM   #8
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
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, 01:07 PM   #9
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,165
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
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, 01:09 PM   #10
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
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, 01:14 PM   #11
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76
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 01:16 PM.
 
Old 06-09-2010, 02:04 PM   #12
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76
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, 02:16 PM   #13
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,165
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
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, 02:50 PM   #14
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76
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, 03:30 PM   #15
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76
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 03:36 PM.
 
  


Reply

Tags
man



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 10:12 AM
waht file have paths for man? man.conf? where? xcore_on Linux - Newbie 4 05-23-2006 09:38 AM
man alsamixer not showing the man page nosaku Slackware 1 12-20-2004 08:52 AM
How to quit man (less) and keep man info on screen? peb Linux - Newbie 7 03-25-2004 10:02 PM
Compiling packages on RH 7.1 causes man files to be named man.gz mmboam Linux - General 0 05-09-2001 06:47 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:17 PM.

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
Open Source Consulting | Domain Registration