I'm using Lubuntu 11.10. I have TeXlive 2011 full insttaled.
I've just installed TeXlive 2013 running install-tl
script. Everything was fine. I choose the small scheme. No problem.
So according to the guide we should do this:
After the installation finishes, you must add the directory of TeX
Live binaries to your PATH—except on Windows, where the installer
takes care of this. For example:
PATH=/usr/local/texlive/2013/bin/i386-linux:$PATH
Use the syntax for
your shell, your installation directory, and your binary platform name
instead of i386-linux.
No problem until here. I changed my $PATH
and when executing pdflatex --version
on the terminal I got
pdfTeX 3.1415926-2.5-1.40.14 (TeX Live 2013)
kpathsea version 6.1.1
But I'd like to know how to take care of the last suggestion:
If you have multiple TeX installations on a given machine, you need to
change the search path to switch between them.
How to do that?
Best Answer
Suppose you have three installations of TeX on your machine, say vanilla TeX Live 2014 and 2015, along with the TeX Live provided by Ubuntu/Debian. The binaries for the three distributions will live in
where
<arch>
might bei386-linux
,x86_64-linux
or another string relative to your machine's hardware architecture.If you set your
PATH
variable within your
.profile
file or with the method of adding a file in/etc/profile.d
(which I recommend), then callingfrom a shell will show
and you're sure that any TeX program will use the tree located in
This is because of how the
kpathsea
library, which all TeX Live programs are linked to, works: it sets a number of runtime environment variables based on the directory where the called binary lives in.You can try seeing this by doing the following distinct calls from the shell (again, use the string for
<arch>
corresponding to your machine's architecture)and you'll receive three different answers:
The program
kpsewhich
is the public interface to thekpathsea
library.You may get into big problems if your
PATH
is not set in such a way that the GUI applications see the vanilla TeX Live binary directory before/usr/bin
. In my test virtual machines I place a file calledtexlive.sh
in/etc/profile.d
containingand I make a symbolic link
/opt/texbin
pointing to the most recent TeX Live I have on the machine, by doingIn this way
echo $PATH
will show something likeprovided no later file in
/etc/profile.d
adds something in front ofPATH
. The important thing is that/opt/texbin
is before/usr/bin
.At a new release of TeX Live you just have to reset the symbolic link and do nothing else: the GUI programs and the shell will find the correct binaries. But, as seen above, you can still run the programs in other TeX distributions.
Remember: when you install a vanilla TeX Live, never set the option “Create symlink in system directories” to “Yes”. Be sure it's set to “No”, particularly on GNU/Linux systems, where a distribution provided TeX Live would take over in case of upgrades.