[Tex/LaTex] Issue with TexLive 2019

texlivetexlive-2019

I have been spending hours trying to read answers and blogs and I cannot understand what is the problem with my installation.

I have installed TexLive under ubuntu 18.04. I can compile latex files, make indexes etc. with no issues. I wanted to install a new package and now I am having a problem.

When I try to install the package I get the following message:

tlmgr: Remote repository is newer than local (2017 < 2019)
Cross release updates are only supported with
  update-tlmgr-latest(.sh/.exe) --update
Please see https://tug.org/texlive/upgrade.html for details.

This is puzzling as I do have TexLive 2019 installed as it shows by running pdflatex --version (I can type this anywhere since everything is in the path):

pdfTeX 3.14159265-2.6-1.40.20 (TeX Live 2019)
kpathsea version 6.3.1
Copyright 2019 Han The Thanh (pdfTeX) et al.
There is NO warranty.  Redistribution of this software is
covered by the terms of both the pdfTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the pdfTeX source.
Primary author of pdfTeX: Han The Thanh (pdfTeX) et al.
Compiled with libpng 1.6.36; using libpng 1.6.36
Compiled with zlib 1.2.11; using zlib 1.2.11
Compiled with xpdf version 4.01

Anyway, I decided to follow the request to use update-tlmgr-latest but, well, I got the following issue:

Verifying archive integrity... All good.
Uncompressing TeX Live Manager Updater  100%
./runme.sh: Cannot find TeX Live root using kpsewhich --var-value=SELFAUTOPARENT.
./runme.sh: (no tlpkg/texlive.tlpdb and/or tlpkg/tlpobj/.)
./runme.sh: Please set your PATH as needed, otherwise it's hopeless.

If I run kpsewhich --var-value=SELFAUTOPARENT I get the following result

/usr/local/texlive/2019

which is the right root of the TexLive 2019. Not sure what to do exactly and now I am stuck as I am not able to install packages.

Any ideas?

Best Answer

Following the suggestions from the comments (@cfr), it appears that such a problem occurs when there is an Ubuntu's installation together with the TexLive 2019 installation which was done using the install-tl.sh script.

To check if this is the case use the following:

dpkg -l | grep texlive

If after issuing the command you get something like this:

ii  texlive-base                                  2017.20180305-1                    all          TeX Live: Essential programs and files
ii  texlive-binaries                              2017.20170613.44572-8ubuntu0.1     amd64        Binaries for TeX Live
ii  texlive-extra-utils                           2017.20180305-2                    all          TeX Live: TeX auxiliary programs
ii  texlive-font-utils                            2017.20180305-2                    all          TeX Live: Graphics and font utilities
ii  texlive-fonts-recommended                     2017.20180305-1                    all          TeX Live: Recommended fonts
ii  texlive-lang-english                          2017.20180305-1                    all          TeX Live: US and UK English
ii  texlive-latex-base                            2017.20180305-1                    all          TeX Live: LaTeX fundamental packages
ii  texlive-latex-extra                           2017.20180305-2                    all          TeX Live: LaTeX additional packages
ii  texlive-latex-recommended                     2017.20180305-1                    all          TeX Live: LaTeX recommended packages
ii  texlive-pictures                              2017.20180305-1                    all          TeX Live: Graphics, pictures, diagrams
ii  texlive-plain-generic                         2017.20180305-2                    all          TeX Live: Plain (La)TeX packages
ii  texlive-pstricks                              2017.20180305-2                    all          TeX Live: PSTricks

then this is indeed the problem.

I was able to solve the issue by removing most of the above packages using:

sudo apt purge texlive-base

and then re-issuing the sudo apt purge texlive-XXX for every other texlive package still remaining (you can check after every purge using the dpkg -l | grep texlive.

After this, you can double check that the texlive 2019 is still where it is supposed to be /usr/local/texlive/2019.