33

When I am trying to update TeX Live I receive an error. Why does this happen and what does the error mean?

$ tlmgr update --self --all

/usr/local/texlive/2019/bin/x86_64-linux/tlmgr: unexpected return value from verify_checksum: -5
3
  • hi Henri! this also happens to me with the default repository http://mirror.ctan.org/systems/texlive/tlnet. I don't have tlcontrib. Do you have any suggestion, or it is better to open another question? Apr 10, 2020 at 8:25
  • 1
    No, you don't have to ask a separate question because the answer remains the same. The return value -5 means that the key is expired. Furthermore you've already go an answer from Norbert on the TeX Live list: tug.org/pipermail/tex-live/2020-April/045307.html Apr 10, 2020 at 8:46
  • thanks Henri! I've seen that. Norbert has been lightning fast! Apr 10, 2020 at 8:50

4 Answers 4

22

In case the issue is not due to tlcontrib, running update-tlmgr-latest.sh solves the problem. Kudos to Norbert Preining for the answer on the TeX Live list! I record here the required steps for posterity.

In case you don't have it, retrieve the script:

wget https://mirror.ctan.org/systems/texlive/tlnet/update-tlmgr-latest.sh

Check if you can run kpsewhich from sudo:

sudo kpsewhich --var-value=SELFAUTOPARENT

If yes, go to the last step. If not, check that the TeXLive path is in your PATH

echo $PATH

If not, add it with

 PATH="/path/to//texlive/:$PATH"

Finally, run the script (make it executable with chmod +x)

sudo env PATH="$PATH" ./update-tlmgr-latest.sh

The env option passes to sudo the PATH already available to the user, without the need to change the PATH of the root user. The output should look like

Verifying archive integrity... All good.
Uncompressing TeX Live Manager Updater  100%  
./runme.sh: updating in /usr/local/texlive/2019...
./runme.sh: tlmgr version says this is TeX Live 2019,
./runme.sh: and this updater script created: Mon Apr  6 15:37:42 CEST 2020.
./runme.sh: proceeding with tlmgr update.
./runme.sh: updating /usr/local/texlive/2019/bin/x86_64-linux ...
./runme.sh: /opt/texbin/tlmgr including objects: master/tlpkg/tlpobj/texlive.infra.tlpobj master/tlpkg/tlpobj/texlive.infra.x86_64-linux.tlpobj
D:appending to package log file: /usr/local/texlive/2019/texmf-var/web2c/tlmgr.log
D:tlmgr:main: ::tldownload_server hash:: {enabled:1,errorcount:0,initcount:0,initcout:1,ua:LWP::UserAgent=HASH(0x564b37fdb010)}
D:setup_programs: preferring system versions
D:program curl found in path
D:program wget found in path
D:program lz4 not usable from path
D:(unix) trying to set up lz4, default /usr/local/texlive/2019/tlpkg/installer/lz4/lz4.x86_64-linux, arg --version
D: Using shipped /usr/local/texlive/2019/tlpkg/installer/lz4/lz4.x86_64-linux for lz4 (tested).
D:program gzip found in path
D:program xz found in path
./runme.sh: done.
11
  • 1
    Thanks! So the OP has installed texlive as root and you provide steps accordingly, but for a home install, I checked without sudo and the installer finds the correct location. Apr 15, 2020 at 19:32
  • 1
    @PlasmaBinturong indeed. If latex and the other executables are in /usr/local/texlive/... sudo is possibly required. If they are in /home/user/..., sudo is most likely not required. Is this what you are saying, aren't you? Apr 16, 2020 at 8:52
  • 13
    On ubuntu 20.04 (texlive 2019) which path should this be? I have /usr/share/texlive for example .
    – graffe
    Aug 17, 2020 at 12:13
  • 8
    I'm with fomin; this fails on Ubuntu 20.04, even though /usr/share/texlive is in the user path and passed to sudo via env
    – levitopher
    Aug 17, 2020 at 20:20
  • 8
    How do I know whether the kpsewhich command worked? Mine prints /, which is not the directory where tex is installed. Does that mean it failed? Sep 20, 2020 at 0:40
8

The return value of -5 means that signature verification for a repository has failed. There is currently a bug in tlmgr that prevents a sensible error message from being printed, but this is being worked on and should be fixed soon:

https://tug.org/pipermail/tex-live/2020-February/044775.html

The most recent incarnation of this problem stems from the fact that the signing key for the tlcontrib repository expired. You can check whether you have tlcontrib enabled by using

$ tlmgr repository list
List of repositories (with tags if set):
    http://contrib.texlive.info/current (tlcontrib)
    http://mirror.ctan.org/systems/texlive/tlnet (main)

The maintainer of tlcontrib (Norbert Preining) has set his PGP key to expire every year, such that if the key were compromised it would become useless eventually. To update to the latest key, just execute the key import that you also executed when you first installed tlcontrib again:

$ curl -fsSL https://www.preining.info/rsa.asc | tlmgr key add -
3
  • 1
    I tried that, and it says the key was imported, but I still get the same error. Sep 20, 2020 at 0:42
  • Instead of using the output of tlmgr repository list to manually search for expired keys, the output of tlmgr key list can be used which directly provides the expiration time.
    – Murmel
    Oct 7, 2020 at 11:50
  • 3
    In my case, it was the main repository that had an expired key. To update that, import the following key as above: tug.org/texlive/files/texlive.asc Apr 28, 2021 at 16:47
6

While still waiting for an official fix, the quickest way to get around this issue is to disable verification of downloads using the verify-repo argument.

Example:

tlmgr install lm-math --verify-repo=none

I can confirm that this works with texlive 2019 under Ubuntu 20.04.

Note: Default texlive version on Ubuntu 20.04 is 2019. Either you should (manually) upgrade to 2020, or make sure your repository is 2019, and not the CTAN default which is 2020.

Here is an official 2019 repository, and you can add it by:

tlmgr option repository http://ftp.math.utah.edu/pub/tex/historic/systems/texlive/2019/tlnet-final
2
  • You can't update TeX Live 2019 anyway, because it has been frozen, so I don't see the point of this. May 30, 2020 at 22:58
  • No you can't update texlive 2019-- that line is just an example. But you can get past the annoying error that way and install packages if you have a 2019 repository.
    – sasan
    May 30, 2020 at 23:26
2

Alessandro's response is excellent, but it's also worth noting that it's recommended to default to your (already installed) TeXLive directory in bash

cd /usr/local/texlive/2021

before running the wget call (although I found that I had to run sudo wget for it to work). This will download the shell file straight into the directory. I found that not doing this and then manually copying the file into the directoty resulted in the sudo kpsewhich call returning an orphaned /, which was very frustrating to solve!

Also, after running

PATH="/usr/local/texlive/2021/bin/x86_64-linux/:$PATH"

it may also be useful to run sudo visudo so that you can add that same path to the front of the 'secure_path' line, then Ctrl+X to save.

I hope this helps.

1
  • Welcome to TeX.SE!
    – Mensch
    Sep 28, 2021 at 14:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.