2

I had installed TeX Live 2022 on Debian 11 with

cd /tmp # working directory of your choice
wget https://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz # or curl instead of wget
zcat install-tl-unx.tar.gz | tar xf -
cd install-tl-*
perl ./install-tl --no-interaction # as root or with writable destination
Finally, prepend /usr/local/texlive/YYYY/bin/PLATFORM to your PATH,
e.g., /usr/local/texlive/2022/bin/x86_64-linux

Now I need to update packages and install new packages that I hadn't installed, so I input:

tlmgr update --all

and see

tlmgr: Local TeX Live (2020) is older than remote repository (2022). Cross release updates are only supported with
update-tlmgr-latest(.sh/.exe) --update See https://tug.org/texlive/upgrade.html for details.

It is weird as there is no TeX Live (2020) on my Debian 11. Then I tried:

  update-tlmgr-latest(.sh/.exe) --update

There is an error:

bash: syntax error near unexpected token `.sh/.exe'

How shoud I fix this problem?

2
  • Maybe which tlmgr will tell you some info? // When I use tlmgr on Ubuntu, I cannot use sudo tmlgr, and have to use the absolute of tlmgr with sudo. Jan 30 at 15:33
  • @TeddyvanJerry Hello. which tlmgr shows /usr/bin/tlmgr. I input the absolute of tlmgr with sudo but it is the same.
    – Y. zeng
    Jan 31 at 1:30

2 Answers 2

1

Regarding the syntax error from bash: the round brackets/parentheses show options you can use, and shouldn't be typed directly. If you are on Windows, use update-tlmgr-latest.exe --update, if you are on Linux or similar (which you are, since you use Debian), use update-tlmgr-latest.sh --update. Read below before you do that, since the error you got indicates some sort of problem.

Given you have installed TeX Live on Debian, you might be running into the problem that there are two versions of TeX Live installed: one from you installing TeX Live 2022, and one installed using the Debian package manager as a dependency for something (which is likely to be older, due to the way Debian packages software). As a result, typing tlmgr may be invoking the wrong one (the Debian installed one, which appears to be TeX Live 2020).

There are instructions to integrate TeX Live with Debian on the TUG Website, but if you have already installed TL via Debian's package manager, you may not be able to clean it well enough (I don't have enough experience with removing packages from Debian to describe any consequences you may have).

On your problem, though, try locate tlmgr and see if there is more than one present. If so, use the full path to the 2022 version to update that install. The comment from Teddy van Jerry suggests using which tlmgr, which will point to the version which is run if you just type tlmgr without a path, so that may also give you information about why you are having problems.


From the comments, below:

tlmgr refers to /usr/bin/tlmgr, which is a symlink to ../share/texlive/texmf-dist/scripts/texlive/tlmgr.pl . This means that there is a TeX Live distribution installed by Debian's package manager.

Rather than delete this manually, or even removing the packages, the issues can be resolved by changing the PATH environment variable of the user. By putting the path to your (manually installed) TeX Live 2022 bin directory at the start of your path, the whole system should work without issue. I'm not sure where you installed TeX Live 2022, but if you installed it in /usr/local/texlive/2022, add /usr/local/texlive/2022/bin/x86_64-linux to your PATH variable.

To update the PATH for your user, edit your user's .bashrc file to add a line like this somewhere near the bottom: PATH=/usr/local/texlive/2022/bin/x86_64-linux:${PATH} and save the file. Start a new shell, and run which tlmgr - it should print out /usr/local/texlive/2022/bin/x86_64-linux/tlmgr (not /usr/bin/tlmgr). If so, you can then use tlmgr update --all to upgrade. Make sure when you edit your .bashrc file that you use the path to the TeX Live you installed, where ever that is. You may also need to do this for root's .bashrc file, if you use sudo tlmgr to update.

9
  • After entering which tlmgr, there is only one line of /usr/bin/tlmgr. And locate tlmgr exports all the lines of texlive/2022, so I can't see there is texlive about 2020. Maybe there isn't texlive of 2020.
    – Y. zeng
    Jan 31 at 1:36
  • @Y.zeng On an install I have here, /usr/bin/tlmgr is a symlink, and I assume yours is as well. What is the output from running ls -l /usr/bin/tlmgr ? That will tell you what file is actually being run when you call tlmgr.
    – enkorvaks
    Jan 31 at 3:56
  • lrwxrwxrwx 1 root root 52 Feb 17 2021 /usr/bin/tlmgr -> ../share/texlive/texmf-dist/scripts/texlive/tlmgr.pl. So, should I delete the folder of ../share/texlive and make /usr/bin/tlmgr point to texlive 2022?
    – Y. zeng
    Jan 31 at 5:04
  • @Y.zeng, I have updated my answer to take into account the information you have provided in the comments, here
    – enkorvaks
    Jan 31 at 5:23
  • But I needn't to keep folder of ../share/texlive, as it is too old and the 2022 version had been installed, so shoudn't I delete it?
    – Y. zeng
    Jan 31 at 5:53
0

This is an answer specifically for MacOS. But solution 2 probably applies to other OSes as well. Note that on MacOS, TeX Live is usually installed through the MacTeX distribution, but it is essentially the same thing.

When trying to update packages (or the package manager itself), I received the error message mentioned in the OP question:

sudo tlmgr update --self
# ...
# tlmgr: Local TeX Live (2022) is older than remote repository (2023).
# Cross release updates are only supported with
#   update-tlmgr-latest(.sh/.exe) --update
# See https://tug.org/texlive/upgrade.html for details.

Solution 1: To recover from this problem without upgrading the entire TeX Live distribution (e.g., from 2022 to 2023), the following worked for me:

  • Open the TeX Live Utility. It is distributed alongside TeX Live and usually resides under /Applications/TeX/
  • Under Actions, choose Reinstall TeX Live Manager.

Solution 2: As described in the section "Distaster recovery" of the tlmgr documentation, it is recommended to use update-tlmgr-latest.sh. The script is available on this website. I have not tested this solution myself, but I suspect that this is what Tex Live Manager ends up using to fix the problem in Solution 1.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .