1

I just installed a newer version of Tex Live on Ubuntu 14.04 LTS 64 bit but when I type in the terminal: tex --version the answer is: TeX 3.1415926 (TeX Live 2013/Debian) Why if I just installed the 2016 version?

Thanks so much!

Aleh
  • 11
  • 1
    (1) welcome, (2) How and what exactly did you just install? My guess is you manually installed upstream texlive, but forgot to manually adjust the PATH variable correctly – daleif Sep 19 '16 at 15:11
  • Hello! Thanks! I downloaded from http://ctan.mirror.garr.it/mirrors/CTAN/systems/texlive/tlnet/install-tl-unx.tar.gz then I wrote in the terminal sudo ./install-tl from the directory where the installation script was located.

    Then I corrected the PATH in the ./bashsc script PATH=~/bin:/usr/local/texlive/2016/bin/x86_64-linux/":$PATH"

    Now when I type in the terminal tex --version TeX 3.14159265 (TeX Live 2016)

    – Aleh Sep 19 '16 at 15:35
  • You have probably not added the path correctly. – daleif Sep 19 '16 at 15:38
  • sorry I didn't finish to edit the answer... I need a Tex version higher then 4, plus when I compile the .tex file in the log I find: This is pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013/Debian) – Aleh Sep 19 '16 at 15:44

1 Answers1

3

Set the $PATH variable to include the binaries of the new TeX installation. On my computer, the programs of TeXLive are in the directory /usr/local/texlive/2016/bin/x86_64-linux, so I added the lines

export PATH=/usr/local/texlive/2016/bin/x86_64-linux:$PATH
export MANPATH=/usr/local/texlive/2016/texmf-dist/doc/man:$MANPATH
export INFOPATH=/usr/local/texlive/2016/texmf-dist/doc/info:$INFOPATH

to $HOME/.profile. To modify the path also for non-interactive shells (like for remote login), you may have to take extra steps depending on your shell and its habits when to load which initialization files. For bash, my $HOME/.bashrc contains

# If running interactively, then:
if [ "$PS1" ]; then
  ... all the commands and aliases only needed interactively
else
  source ~/.profile
fi

In fact, the installation script tells you in the end which directory you have to include in your command path (as well as the adjustments regarding $MANPATH and $INFOPATH).

Additionally I suggest to deinstall the texlive packages from Ubuntu, to avoid that the two TeX installations accidentally interfere. Search for all packages starting with texlive-.

gernot
  • 49,614
  • 1
    No! Do not add it to bashrc, then if, say, you are starting texmaker from a menu, then texmaker cannot find latex as it never execute a bash shell. Might be better to add it to .profile log out and in again. – daleif Sep 19 '16 at 15:38
  • I changed the path in profile and left bashrc as it was originally, but I still have the same problem... – Aleh Sep 19 '16 at 15:48
  • What does echo $PATH say? – gernot Sep 19 '16 at 15:56
  • If you change .profile you have to log out from your session and log in again for the changes to take effect. – gernot Sep 19 '16 at 15:57
  • @daleif Thanks, I didn't think of that since I use TeX from the command line only. But you are completely right, I will edit the post. – gernot Sep 19 '16 at 15:58
  • @Aleh Besides starting a new session: make sure the variable assignments in .profile are prefixed with export. – gernot Sep 19 '16 at 16:10
  • this is exactly what I added in the profile file:

    export PATH=~/usr/local/texlive/2016/bin/x86_64-linux/":$PATH"

    Then I started a new session as well, now the log file of my .tex says:

    This is pdfTeX, Version 3.14159265-2.6-1.40.17 (TeX Live 2016) (preloaded format=pdflatex 2016.9.19) 19 SEP 2016 18:14

    but the version is still the wrong one... I need a version higher than 4. Sorry, I am not so expert...

    – Aleh Sep 19 '16 at 16:28
  • echo $PATH says /usr/local/texlive/2016/bin/x86_64-linux/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games – Aleh Sep 19 '16 at 16:37
  • @Aleh did you actually install it into your home directory (as you indicate here with the ~/) or is it in /usr/local/... (which sounds more normal) – daleif Sep 19 '16 at 16:39
  • Sorry before I corrected the .profile with export PATH=/usr/local/texlive/2016/bin/x86_64-linux/:$PATH export MANPATH=/usr/local/texlive/2016/texmf-dist/doc/man:$MANPATH export INFOPATH=/usr/local/texlive/2016/texmf-dist/doc/info:$INFOPATH – Aleh Sep 19 '16 at 16:40
  • @gernot I'm a cli jockey as well, but so many Linux users have been having issues so better leave a better version for others to find. – daleif Sep 19 '16 at 16:44
  • @Aleh you'll know that you got it right when which latex (in a terminal) gives the correct path to latex – daleif Sep 19 '16 at 16:55
  • 1
    @Aleh There is definitely no TeX version higher than 4. There will never, ever, be one because TeX versions are numbered by expanding the decimal places of pi. Your version is exactly the same version I have, installed today. So what's wrong with your current installation? – gernot Sep 19 '16 at 17:20
  • You can simply do source ~/.profile: no need to start a whole new section. Nor do you need to add the export before each line. But @Aleh: your $PATH is now OK. – jon Sep 19 '16 at 18:37
  • @jon I think export is necessary in ~/.profile since it may also be processed by other shells, including plain sh. What do you mean by starting a new section? Or did you mean session? If you want to make sure that also the programs started from the GUI take notice of the changed PATH, then sourcing the profile in some subsidiary command shell doesn't help. – gernot Sep 19 '16 at 19:21
  • @gernot -- Oops, I meant 'session', not section. And that, of course, source-ing would (only) affect the current instance of the terminal session. ... I lost the context of the bigger question as I only start programs from a shell. Does that impact the need for export also? I've never used export in .profile and I've never had a problem. How would I trigger the failure to find, say, pdflatex (just curious)? – jon Sep 19 '16 at 19:39
  • @jon Probably in Linux it doesn't really matter since sh has been replaced by bash, as far as I know, so it's maybe only relevant for other Unixes. But for classical sh and maybe other shells, variable settings are only handed over to sub-processes if they are exported. – gernot Sep 19 '16 at 21:21
  • Thanks all! Your comments were really useful. So, if I got it right, now my Tex Live version is up to date. Unfortunately Copernicus still doesn't accept the pdfs that it produces. But definitely the point was to add to the .profile file the PATH,MANPATH,INFOPATH lines, with export at the beginning of all of them. Thanks! – Aleh Sep 20 '16 at 08:12