I'm a LyX user. Can I move all (or most) of the TeX related files/folders to another (Linux) partition (
/data) and so reuse that partition for LyX-TeX after OS re-install, as well as share that TeX partition between two distros (Lubuntu and Mageia LXDE)?
The TeX Live binaries "know" the location of the TeX Live tree (files, fonts and so on), because they set implicitly some environment variables whose value depends on the location of the binaries themselves.
On a Unix system it's so sufficient that the
PATH environment variable contains a pointer to the binaries, for example something like
(How to set the
PATH variable is very system dependent). If you want to move the TeX Live tree to a
/data partition, do it so that it's in
and modify the
PATH variable so that the location for the binaries is
The final bit depends on the operating system, just look what's in the
texlive/2011/bin directory to find the name.
It won't be a problem to share the tree between two GNU/Linux distributions, so long as they use the same binaries. But it's also possible to have more than one set of binaries (say the 32 bit and the 64 bit varieties): all you need is to have the correct pointer in the
A method that I find very easy to manage is to create a symbolic link:
ln -s /data/texlive/2011/bin/x86_64-linux /usr/texbin
/opt/texbin if one prefers) and use
/usr/texbin in the PATH variable. In this way, when the update to TeX Live 2012 is available, it can be installed directly under
/data/texlive (by modifying the default directory at installation time) and all that's needed to activate the new binaries becomes
rm /usr/texbin ln -s /data/texlive/2012/bin/x86_64-linux /usr/texbin
(with suitable privileges, of course), without modifying the personal
.profile file or any global file.
Similar symbolic links can be created for man pages and info files.
I guess from the tag
texlive that you use texlive indeed, on a Linux machine. It may not work to use the moved installation from both Linux distributions, if you got texlive from your distribution. E.g. the texlive openSuse delivered (years ago) was different from the original texlive. Other possible error: One distribution were 32bit, other 64bit. So there are pitfalls.
However, to me it seems recommendable to install the original 'texlive' not into /opt or /usr, but into a separate partition, e.g. /local . You can update by
tlmgr without interfering ẁith your package manager. You can install
texlive independently and you can install the OS independently.
I don't recommend to install Lyx as well there. Use the Lyx your distributions deliver.
My experience from the last three years doing so is: it makes teXing easier.
Thanks to egreg and this guy on latex-community.org for LyX config, the steps I've taken are as follows (my architecture is x86_64):
Enter this in terminal to copy the Texlive directory:
cp -r /usr/local/texlive /data/texlive
If everything goes right you can remove the original Texlive later on.
Now edit the
~/.profile file like so:
# set PATH so it includes user's private bin if it exists if [ -d "$HOME/bin" ] ; then PATH="$HOME/bin:$PATH" fi # set PATH so it includes TexLive if [ -d "/data/texlive/2011/bin/x86_64-linux" ] ; then PATH="/data/texlive/2011/bin/x86_64-linux:$PATH" fi if [ -d "/data/texlive/2011/texmf/doc/man" ] ; then MANPATH="/data/texlive/2011/texmf/doc/man:$MANPATH" fi if [ -d "/data/texlive/2011/texmf/doc/info" ] ; then INFOPATH="/data/texlive/2011/texmf/doc/info:$INFOPATH" fi
Now to set the path to binaries in LyX, go to Tools > Preferences > Paths > PATH Prefix and enter:
"Apply", "Save" and restart LyX. Go to "Tools > TeX Information", check "Show path" and "Rescan". If all is set correctly, LyX should find the new path. (I have simply quoted briefly the guy I've mentioned above.)
On a side note, Buntus/Debian have LyX bundled with the TeX dependency in their repositories, but that TeX part is very old (Texlive 2009). So I've installed the 3 GB Texlive 2011 and installed LyX from the terminal as it's reccomended in LyX website:
sudo apt-get --no-install-recommends install lyx