I just finished installing LaTeX for my company's Ubuntu server that we all SSH into to use. At the end of the install it says this:

Add /usr/local/texlive/2010/texmf/doc/man to MANPATH, if not dynamically determined.

Add /usr/local/texlive/2010/texmf/doc/info to INFOPATH.

Most importantly, add /usr/local/texlive/2010/bin/x86_64-linux to your PATH for current and future sessions.

How do I do this so that these variables are set for all users on the system? (And yes, I have sudo permissions).

  • @geirha's answer (with Rob's comment on MANPATH) resolves this except for the INFOPATH variable. Though I imagine it is not often used by users(?), does anyone know the correct location to set that? Should it also be /etc/environment ?
    – belacqua
    Feb 5, 2011 at 19:27
  • @jgbelacqua afaik Debian and some other Linux distros use it but not Ubuntu. Or at least thats the best I could gather frm searching on google for an hour.
    – Rob S.
    Feb 5, 2011 at 21:36
  • When you installed TeXlive 2010, it should have asked you if you wanted to create symlinks for all the binaries. If you had said yes, this wouldn't have been an issue at all.
    – frabjous
    Feb 6, 2011 at 1:10
  • @frabjous It never asked me. The only command I ever gave it was "i" in the beginning to initiate the installation. Anyways, after setting the variables, it all works perfectly.
    – Rob S.
    Feb 6, 2011 at 15:01
  • 1
    @frabjous: The symlink option seems to be now missing from the installer. I installed TeXLive 2011 today and could find it anymore. I installed TeXLive in multiple versions at least a dozen times before, so I wondered why it isn't there anymore. May 1, 2012 at 10:20

2 Answers 2


You add those to /etc/environment.

It likely already has a line for PATH, so you just append :/usr/local/texlive/2010/bin/x86_64-linux to the end of that. Then add two new lines for MANPATH and INFOPATH.

See https://help.ubuntu.com/community/EnvironmentVariables.

After editing /etc/environment, log out and back in, and check that e.g. echo "$MANPATH" outputs the value you added.

  • In the end I also had to edit /etc/manpath.config. Thanks.
    – Rob S.
    Feb 5, 2011 at 18:09
  • 2
    I've deleted my answer, as this appears to be a better choice. According to help.ubuntu.com/community/EnvironmentVariablesSystem-wide /etc/environment is the place for "Environment variable settings that affect the system as a whole (rather then just a particular user) [...]" /etc/profile and /etc/bash.bashrc are listed as 'Not recommended'
    – belacqua
    Feb 5, 2011 at 18:29
  • 1
    Annoyingly doesn't work for root!
    – Owl
    Apr 9, 2019 at 8:49

Add these default PATH to /etc/profile. It will work for bash and sh. Bash is default in Ubuntu.

PATH=$PATH:<new path you need to add>

echo $SHELL can be used to determine the shell of current user or can be viewed from /etc/passwd file.

Alternatively you can include it in /etc/environment as well. Here you can just add the PATH at the end of PATH statement.

  • I opened up etc/profile in vim and there was nothing regarding PATH in it. Thanks for the reply just the same.
    – Rob S.
    Feb 5, 2011 at 17:22
  • 21
    The order of execution of files is /etc/environment -> /etc/profile -> /etc/bash.bashrc -> /home/<user>/.profile -> /home/<user>/.bashrc
    – Jamess
    Feb 6, 2011 at 10:11
  • editing /etc/profile path variable could damage system and its better to avoid. specially when you are connecting to remote host via ssh. Aug 25, 2019 at 5:21

You must log in to answer this question.

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