1

When I experimentally install some new software, I don't go through the extra effort of putting all assets in the right places like /usr/local/man.

Occasionally, I'd like to have manpage support for it but I don't want to crowd my base Linux installation with it (after a few months, the new tool falls out of use). For binaries, this isn't a problem because $PATH can be appended to with wherever I've put my short/medium-term executable. But is there an equivalent for man assets?

(come to think of it, I'm not 100% sure what the difference between doc and and man is but I'm assuming man is what gets searched by apropos, which infuriatingly gives me zero results for almost everything)

1

1 Answer 1

1

The "equivalent" of $PATH is $MANPATH. See man 1 man:

MANPATH

If $MANPATH is set, its value is used as the path to search for manual pages.

See the SEARCH PATH section of manpath(5) for the default behaviour and details of how this environment variable is handled.

Maybe you don't need to use $MANPATH; consider relying on the default behaviour. The most relevant fragments of man 5 manpath:

By default, man-db examines the user's $PATH. For each path_element found there, it adds manpath_element to the search path.

If there is no MANPATH_MAP line in the configuration file for a given path_element, then it adds all of path_element/../man, path_element/man, path_element/../share/man, and path_element/share/man that exist as directories to the search path.

It then adds any MANDATORY_MANPATH entries from the configuration file to the search path.

[…]

The $MANPATH environment variable overrides man-db's default manual page search paths. Most users should not need to set it. Its syntax is similar to the $PATH environment variable: it consists of a sequence of directory names separated by colons. It overrides the default search path […].

If the value of $MANPATH starts with a colon, then the default search path is added at its start. If the value of $MANPATH ends with a colon, then the default search path is added at its end. If the value of $MANPATH contains a double colon (::), then the default search path is inserted in the middle of the value, between the two colons.

There is also a command manpath. It may be useful in debugging your setup.

The links in this answer point to manpages of Ubuntu. In general refer to documentation and manuals of your specific distro.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .