Where should I install manual pages in user directory?

You can put the man pages in this directory:

$HOME/.local/share/man

Accessing directly

And then you can access them directly using man:

man $HOME/.local/share/man/manX/manpage.1.gz

$MANPATH

You can check what the $MANPATH is with the command manpath, or echo out the environment variable $MANPATH.

Examples

$ manpath
manpath: warning: $MANPATH set, ignoring /etc/man_db.conf
/home/saml/apps/perl5/perlbrew/perls/perl-5.14.0/man:/home/saml/.rvm/rubies/ruby-1.9.2-p180/share/man:/home/saml/.rvm/man:/usr/local/share/man:/usr/share/man:/usr/brlcad/share/man:/usr/man:/usr/brlcad/share/man:/usr/brlcad/share/man

$ echo $MANPATH
/home/saml/apps/perl5/perlbrew/perls/perl-5.14.0/man:/home/saml/.rvm/rubies/ruby-1.9.2-p180/share/man:/home/saml/.rvm/man:/usr/local/share/man:/usr/share/man:/usr/brlcad/share/man:/usr/man:/usr/brlcad/share/man:/usr/brlcad/share/man

You can add things to the MANPATH temporarily:

MANPATH=$HOME/.local/share/man:$MANPATH

If you want to make this permanent then add a file in your /etc/profile.d/ directory called myman.bash with the above MANPATH= line in it. This will get picked up system wide for everyone. If you want it to be just for you, then add it to your $HOME/.bash_profile or $HOME/.bashrc.


I have installed a few apps that I compiled, with the respective configures set for installing in ${HOME}/usr/local.

I find now that I have directories

~/usr/local/share/man/man1
~/usr/local/share/man/man3
~/usr/local/share/man/man5

with manpages gnuplot.1, gnuplot-ja.1, python3.1, python3.5.1, libpng.3, libpngpf.3, zlib.3, png.5, so I guess (given my prefix) it is a pretty standard location for apps installed locally.

It is then a candidate location for the cases where one has to choose manually the local man directory.

Of course, one can add arbitrary paths (and should do it even in the usual just case mentioned) for man pages with

export MANPATH="$HOME/usr/local/share/man${MANPATH:+:${MANPATH}}"

(see this).

Tags:

Man