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.
which tlmgr
will tell you some info? // When I usetlmgr
on Ubuntu, I cannot usesudo tmlgr
, and have to use the absolute oftlmgr
withsudo
.which tlmgr
shows/usr/bin/tlmgr
. I input the absolute oftlmgr
withsudo
but it is the same.