Search code examples
linuxmanpage

Linux: Man command in application installed only for current user


Manual files in Linux are stored in /usr/share/man. Before, my application could only be installed by a root user and it put the manual files in this directory. Now, I want to enable non-root installation; to achieve this, all my data and configuration files will be installed under ~/<appname>/. However, manual files copied to home will no longer be accessible by man command.

What are the usual workarounds to this problem?

I've thought in creating a "man" command in my application that runs man -M /<man_path>/<appname>/ (as this is easier to users than running the command by themselves). Is this a good option?

Thanks in advance.


Solution

  • [spatel@ap4004 appname]$ export MANPATH=/home/spatel/appname/man
    
    [spatel@ap4004 appname]$ manpath
    /home/spatel/appname/man/en:/home/spatel/appname/man
    

    Other workaround is command alias

    [spatel@ap4004 appname]$ alias man='man -M /home/spatel/appname/man'
    
    [spatel@ap4004 appname]$ alias man
    alias man='man -M /home/spatel/appname/man'