[Tex/LaTex] How to install “vanilla” TeXLive on Fedora

installinglinuxlinuxfedoratexlive

Fedora has provided a very good texlive packaging. But, I think it's best to install texlive directly, using ./install-tl command. I have installed texlive directly on Ubuntu system before, by using this guide:

How to install "vanilla" TeXLive on Debian or Ubuntu?

(thanks to Torbjørn T, for the complete guide).

Now, I'm currently using Fedora 23 Workstation. Is there a way to install texlive directly on Fedora 23 ? Is there any fake packages to make Fedora think that we have already installed the texlive, i.e, similar to equivs package on Debian?

Best Answer

Duck

How to install TeX Live in Fedora – a quick guide for ducks

No ducks were harmed during the making of this guide.

Step one: Obtain the official Unix installer from TUG. If you want to use the terminal directly, open it and type:

$ wget http://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz

Step two: Time to unpack the installer and run it! Personally, I like the command line, so in the terminal, go to the directory where you downloaded install-tl-unx.tar.gz and type:

$ tar xvzf install-tl-unx.tar.gz

You will get a directory named install-tl-<build date>, where <build date> is the date referring to the latest installer build (your mileage may vary). Let us delve into the installation, so type:

$ cd install-tl-*
$ sudo ./install-tl

The installer will appear in your terminal screen:

< verbose output, suppresed here because it is too complex for ducks >

 <O> options:
   [ ] use letter size instead of A4 by default
   [X] allow execution of restricted list of programs via \write18
   [X] create all format files
   [X] install macro/font doc tree
   [X] install macro/font source tree
   [ ] create symlinks to standard directories

 <V> set up for portable installation

Actions:
 <I> start installation to hard disk
 <H> help
 <Q> quit

Enter command: 

Now, simply choose I and wait until the installation finishes.

Step three: Let us add a symbolic link to the TeX Live binary directory! Open the terminal and type the following:

$ sudo ln -s /usr/local/texlive/<year>/bin/<arch> /opt/texbin

Please, replace <year> and <arch> by the correct year and architecture. In my case, I'd run:

$ sudo ln -s /usr/local/texlive/2016/bin/x86_64-linux /opt/texbin

Now, we can refer to the TeX Live binaries by providing the symbolic reference /opt/texbin. When installing newer versions, it's just a matter of simply updating the symbolic link and everything is ready to go.

Step four: In your terminal, type the following:

$ gedit texlive.sh

The GEdit editor will appear with a blank document named texlive.sh. Copy and paste the following text (courtesy of egreg):

#!/bin/bash
pathmunge () {
    if ! echo $PATH | /bin/egrep -q "(^|:)$1($|:)" ; then
        if [ "$2" = "after" ] ; then
            PATH=$PATH:$1
        else
            PATH=$1:$PATH
        fi
    fi
}
pathmunge /opt/texbin
unset pathmunge

Save the file in GEdit and close it. You will be back to the terminal screen. Now type:

$ sudo mv texlive.sh /etc/profile.d/

This script ensures the /opt/texbin entry will be in your path, before any other entry. After running the command, close your terminal and open it again (this is important). Now, try running:

$ which pdflatex
/opt/texbin/pdflatex

If you get the output shown above, everything is set up perfectly!

Step five: Now, let us configure the OpenType fonts from TeX Live. Open the terminal and type:

$ sudo cp $(kpsewhich -var-value TEXMFSYSVAR)/fonts/conf/texlive-fontconfig.conf /etc/fonts/conf.d/09-texlive.conf
$ sudo fc-cache -fsv

Wait a couple of seconds (or minutes) and we are done!

Have fun with TeX Live and Fedora!

Related Question