Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have added extra directories to $PATH by exporting PATH=/my/dirs:$PATH But I am not sure if I should do the same to MANPATH. Because default MANPATH is empty yet man command works. I found a command called manpath and its manual says If $MANPATH is set, manpath will simply display its contents and issue a warning.. Does this mean setting MANPATH is not the right way to add directories for man command to search for manual pages?

share|improve this question
add comment

1 Answer 1

IMO you should add your custom directories at the end of your PATH

PATH=$PATH:/my/dirs

This is so that your custom directories do not over ride system binaries / libs and is a minor security issue.

you set MANPATH the same way (MANPATH is empty by default).

MANPATH=$MANTPATH:/my/dirs

You should not need to set a MANPATH with well behaved packages, so if it is not broken don't fix it and if it is broken, perhaps you are better filing a bug report ;)

Add this to ~/.bashrc

export PATH=$PATH:/my/dirs
export MANPATH=$MANPATH:/my/dirs
share|improve this answer
    
Typo in the second statement? MANPATH=$MANTPATH:/my/dirs Maybe should be: MANPATH=$MANPATH:/my/dirs –  kevinarpe Nov 11 '13 at 9:25
    
What do you mean by "well behaved packages"? I have a whole set of tools that are not installed in the usual places (HPC clusters often put things in /opt). How should they register their man pages without using $MANPATH? –  i_grok Mar 15 at 15:30
    
"well behaved packages" are written to use standard paths and environmental variables. Poorly behaved packages use non standard, at least to Ubuntu, paths such as /opt or do not use environmental variables and thus lead to your observation " I have a whole set of tools that are not installed in the usual places (HPC clusters often put things in /opt)" –  bodhi.zazen Mar 15 at 16:55
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.