Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I think I understand the instructions given in How to add a directory to my path? about adding directories to $PATH. But I don't understand how to add directories to $MANPATH or $INFOPATH.

Also -- in googling around for help I have noticed that sometimes directions say export PATH=/usr/share/lib/something:$PATH and sometimes they say export PATH=$PATH:/usr/share/lib/something. Which is it?

share|improve this question

2 Answers 2

up vote 14 down vote accepted
  1. These 2 are almost the same:

    export PATH=/usr/share/lib/something:$PATH 
    export PATH=$PATH:/usr/share/lib/something
    

    The only difference is that the first one puts the directory to add in front and the second one puts it behind the current directories in $PATH. It only matters if there are commands inside /usr/share/lib/something that have the same name inside one of the directories in $PATH.

  2. To add directories to $MANPATH or $INFOPATH as required from the link you posted you do that by changing the config files inside the link.

    It says to open the global version of bash.bashrc with:

    sudo vi /etc/bash.bashrc
    

    and to add at the end:

    PATH=/usr/local/texlive/2010/bin/x86_64-linux:$PATH; export PATH
    MANPATH=/usr/local/texlive/2010/texmf/doc/man:$MANPATH; export MANPATH
    INFOPATH=/usr/local/texlive/2010/texmf/doc/info:$INFOPATH; export INFOPATH
    

    This sets $PATH, $MANPATH and $INFOPATH. And it also tells you to edit /etc/manpath.config with:

    sudo vi /etc/manpath.config
    

    and to add

    MANPATH_MAP /usr/local/texlive/2010/bin/x86_64-linux /usr/local/texlive/2010/texmf/doc/man
    

    underneath # set up PATH to MANPATH mapping.


If you are unsure about this make a backup 1st (never a bad thing) with:

sudo cp /etc/bash.bashrc /etc/bash.backup_$(date +"%Y_%m_%d").bashrc
sudo cp /etc/manpath.config /etc/manpath.backup_$(date +"%Y_%m_%d").config

The weird string changes into the current date. If you mess up just copy the backup back over the original file:

$ touch test1
$ cp test1 test1.$(date +"%Y_%m_%d")
$ ls
test1  test1.2014_11_14  
share|improve this answer
1  
I installed texlive 2012 on Ubuntu Precise and echo $MANPATH returns /usr/local/texlive/2012/texmf/doc/man to me. When I add the paths to the configuration bash reports /usr/local/texlive/2012/texmf/doc/man:/usr/local/texlive/2012/texmf/doc/man and zsh still report /usr/local/texlive/2012/texmf/doc/man. For zsh I add the paths to /etc/zsh/zshrc. I am not sure if this is correct. I also tried editing /etc/environment, as suggested here‌​, though without success. –  JJD Aug 16 '12 at 23:18
    

If your man pages are in /usr/local/myproject/man, all you need to do is add that to (the end of) /etc/manpath.config:

MANDATORY_MANPATH        /usr/local/myproject/man
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.