Monday, June 25, 2007

Setting up Solaris Man Pages

In most Linux distributions the documentation is fairly well unified and centralized. You can find your man pages in /usr/share/man and other documentation in /usr/share/doc. Solaris likes to spread its documentation out a bit more. This is convenient when adding third-party packages or software because it keeps the system's man pages separate from the software. It is inconvenient when software creates a new manual location and doesn't tell the system about it.

The system will search the MANPATH for man pages whenever you use man, whatis, or apropos. This variable is just like the usual PATH in that it is a colon-separated list of paths. For example to set a MANPATH that includes /usr/share/man and /usr/sfw/share/man, and you use pkg-get to install software in /opt/csw, then you might use,

MANPATH=/opt/csw/share/man:/usr/sfw/share/man:/usr/share/man

Now you can can type man vim and get the manpage from /opt/csw/share/man/man1/vim.1.gz to dipslay. Of course if you were to try apropos vim you would get an error:

/opt/csw/share/man/windex: No such file or directory

Oops. Apropos needs a whatis index to be built. You will need to run catman to build the indexes. It will automatically use your MANPATH to do so.

catman -w

Now you can apropos and man to your heart's content.

No comments: