How do I set PATH variables for all users on a server?
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).
102 Answers
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 .
After editing /etc/environment, log out and back in, and check that e.g. echo "$MANPATH" outputs the value you added.
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.