Previous Section  < Day Day Up >  Next Section

Recipe 1.6. Configuring Your manpath

1.6.1 Problem

You're repeatedly having trouble finding man pages; using tools from Recipe 1.4, you find that most of the missing pages are in a directory that man doesn't seem to know about. Perhaps a newly-installed program put its man pages in a strange place, like /opt/man. Or perhaps you want to put some man pages in a nonstandard location. How do you configure man to find them?

1.6.2 Solution

Edit /etc/manpath.config.

Suppose the directory you want to add is /opt/man. Add /opt/man to /etc/manpath.config:

# every automatically generated MANPATH includes

# these fields


MANDATORY_MANPATH                   /usr/man

MANDATORY_MANPATH                   /usr/share/man

MANDATORY_MANPATH                   /usr/X11R6/man

MANDATORY_MANPATH                   /usr/local/man

MANDATORY_MANPATH                   /opt/man

And you're done. Now man will find the man pages in the new directory.

When you create a custom man page directory, be sure to include the section directories:

$ ls /opt/man/local

man1  man2  man3  man4  man5  man6  man7  man8  man9

It's not necessary to include all the numbered sections, just the ones pertinent to the man pages you'll be storing there.

If you're going to have subdirectories—for example, /opt/man and /opt/man/local—be sure to list them in this order:

MANDATORY_MANPATH                   /opt/man/local

MANDATORY_MANPATH                   /opt/man

Subdirectories must be listed before parent directories, or they will be overlooked by the man viewer.

1.6.3 Discussion

You can run manpath with no options to see your current manpaths:

$ manpath


1.6.4 See Also

  • manpath(1), manpath(5)

    Previous Section  < Day Day Up >  Next Section