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 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).

share|improve this question
    
@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 '11 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 '11 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 '11 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 '11 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. –  Martin Scharrer May 1 '12 at 10:20

2 Answers 2

up vote 18 down vote accepted

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.

share|improve this answer
    
In the end I also had to edit /etc/manpath.config. Thanks. –  Rob S. Feb 5 '11 at 18:09
1  
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 '11 at 18:29

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

If you edit here add a line like this.

PATH=$PATH:

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.

share|improve this answer
    
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 '11 at 17:22
4  
The order of execution of files is /etc/environment -> /etc/profile -> /etc/bash.bashrc -> /home/<user>/.profile -> /home/<user>/.bashrc –  Jamess Feb 6 '11 at 10:11

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.