0

It seems that I cannot install packages on WSL running Ubuntu. I installed TexLive with sudo apt-get install texlive. It ended up in being installed in /usr/share and I also have a ~/texmf folder.

If I run e.g. tlmgr --usermode install standalone I get the following error message:

tlmgr: Local TeX Live (2021) 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.

I downloaded and run the update-tlmgr-latest.sh getting the following error:

Verifying archive integrity...  100%   MD5 checksums are OK. 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.

Fine, it looks like that I have to include the texlive installation folder in the PATH. I added /usr/share/texlive to the PATH but the error didn't go away. Thinking that I could have added a wrong path I googled what could be the path format of a texlive installation with no success. Programs such as pdflatex and tlmgr are installed in /usr/bin

I tried another route. the output message suggests to read an upgrade.html page. I open it and it says By default, please get the new TL by doing a new installation instead of proceeding here. I followed the instructions in the link and I get error: /usr/local/texlive does not exist (as expected since I have my installation in /usr/share but I cannot see an easy way to tell the installer to consider that path).

I don't know how to proceed further.

EDIT: I am asking how to install packages through tlmgr (generalization) whereas the suggested answer "How to make standalone package available by my LaTeX installation?" is requesting how to install a specific package, that is, the standalone package (specialization).

Although the answer is the same, the question is different, hence, I would be perfectly fine if the closing criteria is "The answer given here applies to this question as well" and not "this question has already answered here" because that would be false and misleading, given that the two questions are different.

Furthermore, a user that wants to know how to install a package through tlmgr would most likely query "how to install packages with tlmgr" rather than "how to install standalone package".

EDIT2: In the "Best way to install packages for TeXLive in Ubuntu?" user is explicitly asking "Can apt-get install or something similar be used?" whereas I am concerned in the tlmgr usage.

Barzi2001
  • 477
  • 3
    linux packaged tex systems installed with apt should always be updated via apt not via tlmgr – David Carlisle Feb 26 '24 at 13:52
  • I run sudo apt upgrade texlive but the texlive version is still 2021. – Barzi2001 Feb 26 '24 at 13:58
  • 2
    that is not surprising, linux systems do notchange the texlive they package every release of texlive (it depends on the details of the linux distrib you are using) you can ignore the linux one and get texlive 2023 (or texlive 2024 pretest) from tug if you wish that would be in /usr/local/texlive/2023 by default and managed with tlmgr, you have to be careful about removing the apt-installed one as many apt packages will have a depency on it and re-install it. simplest is to leave it there but put the tug texlive at the front of the path – David Carlisle Feb 26 '24 at 14:03
  • Ok, I expected that the apt repo would update texlive every once in a while, and I was not aware of the issue tlmgr/apt. I installed it through apt because most of the google hits pointed in that direction but I should have used the tug. In-fact now I am a bit in trouble due to uninstalling the apt installed texlive that is scaring me quite a lot! – Barzi2001 Feb 26 '24 at 14:14
  • 1
    well it is the same as every program you have in linux. you can use the system apt (or dpkg or yum or whatever it uses) which gives the advantages of consistent dependencies and common interface, but if you want the bleeding edge version you need to install from some upstream source. There is no right answer. I use tugs (and at times compile that from source to be ahead of what they distribute) but for most people most of the time the version distributed by their linux is fine. there are several answers on this site detailing how to manage the different versions if you install both. – David Carlisle Feb 26 '24 at 14:53
  • Fine with that. But then why tlmgr --usermode install standalone didn't install anything but returned a message about newer texlive version? It didn't explictly told me "If you want to install (that) package then you must upgrade your tex installation" but still... :D – Barzi2001 Feb 26 '24 at 15:00
  • @Barzi2001 The message tells you, that you are trying a cross release update, that tlmgr does not support this, how you could do it (if really intended and not only a mistake), and what you should read. So in this case the message is IMHO fine, but users are different, so I understand that someone may not understand the message. But this would be the trouble with almost every message. – cabohah Feb 27 '24 at 07:43
  • What the message and also the upgrade instructions indeed not tell: Upgrading a Linux distribution TeX Live to a vanilla TeX Live is not really supported. I've tried this for fun some years ago (with SuSE Linux not WSL). AFAIR I needed to copy /usr/share/texlive to /usr/local/texlive/NETVERSION, had to add the binary directory structure to that copy, had to copy some files to the binary directory etc. At some point I've stopped the try, because it was to time consuming. – cabohah Feb 27 '24 at 08:22
  • @cabohah Fine with everything, but then: given my setup, how shall I install standalone package without the need of installing additional things that I don't need? Next, I think that user shall be warn before running sudo apt install texlive that tlmgr won't be an option because it is fairly an important thing to know beforehand. Having a minimal degree of redundancy for critical aspects is generally a good idea, don't you agree? – Barzi2001 Feb 27 '24 at 09:17
  • 1
    When you are using the Linux TeX Live packages, you can use the Linux package file search to find, which Linux package you need to install to get standalone.cls (or standalone.sty). For debian/ubuntu you need apt install texlive-latex-extra). Therefore … – cabohah Feb 27 '24 at 09:46
  • If you think, the debian/ubuntu tex live packages should be smaller (e.g. each vanilla tex live package should result in a single debian tex live package), or if you think, debian/ubuntu should not provide tlmgr or should provide a modified tlmgr please do a debian feature request. We are not responsible for this and therefore your request would be off-topic here. – cabohah Feb 27 '24 at 09:52
  • It is crystal clear now that tlmgr and apt don't smoothly coexist. That fixes everything. You don't need a PhD to understand that latex and ubuntu are two different things and that you are not responsible for it, but thanks for the heads up anyway. Finally, how to install packages with tlmgr and how to install the standalone package are profoundly different questions (you may want to google specialization vs generalization), it is not my fault if you cannot see it. Sorry. – Barzi2001 Feb 27 '24 at 10:13
  • 2
    Hint: The proposed duplicate deviates from the OPs self-answer, AND it doesn't seem to adress the problem posted. – MS-SPO Feb 27 '24 at 11:09
  • @samcarter_is_at_topanswers.xyz you can kind of guess an answer by reading all the answers therein contained, but the question asked is profoundly different. In the body of such a question the user there asks "if it is possible to use apt-get install" whereas my question is essentially "how to use tlmgr". Big difference I would say, I am not sure if all users downvoting and requesting to close this question can see it. – Barzi2001 Feb 27 '24 at 11:22
  • @Barzi2001 It does not matter so much if the question is the same as long as the answers apply. Both your options A and B are covered by the answers to "Best way to install packages for TeXLive in Ubuntu?". The duplicate model of stackexchange uses dupe questions as sign posts which will lead users who search for "how to use tlmgr" to these answers. A question "How to colour the text red" can be duplicate of a question "How to colour the text blue" because the answer "use xcolor" applies to both. – samcarter_is_at_topanswers.xyz Feb 27 '24 at 11:24
  • @samcarter_is_at_topanswers.xyz so you are saying that future users that had problems in installing packages with tlmgr after they installed installed texlive through apt shall NOT google e.g. "how to use tlmgr with Ubuntu" but they shall instead google "how to install standalone" or (even worst) "how to install latex packages with apt-install" (wht?!) to avoid getting downvoted to the ground and have tons of requests for closing the question? If I need to buy a pair of shoes of a certain brand I would not google "how to prepare fried rice". Or am I weird? – Barzi2001 Feb 27 '24 at 11:36
  • @samcarter_is_at_topanswers.xyz and in all honesty I don't see where is the problem in having a precise question with a precise answer which is also easily searchable instead of having this weird connections of unrelated questions that may have an answer that may apply to the original question. Is it sooo bad to have a clear and searchable question with a clear answer? – Barzi2001 Feb 27 '24 at 11:41
  • @Barzi2001 Future users with the same problem like you shall duckduckgo "Can't install packages on WSL (Ubuntu) with tlmgr", they will find your question and from there the link to the answers. – samcarter_is_at_topanswers.xyz Feb 27 '24 at 11:41
  • @Barzi2001 Using your question as a signpost to the duplicate won't remove it. Users will still be able to find your question and your answers. It will just make it easier for them to find the duplicate as well. What could you possible find bad about this? – samcarter_is_at_topanswers.xyz Feb 27 '24 at 11:47
  • @samcarter_is_at_topanswers.xyz and where is the gain with that approach? Also, note that people can identify the answer to their problem by reading such answers, it may not be explicitly given. Furthermore, by extending your reasoning then >99% of the questions can find an answer on some remote manual, so the answer to >99% of the questions could be, correctly, RTFM. Do you think that may be a good model? I am genuinely asking... :) – Barzi2001 Feb 27 '24 at 11:48
  • Using the duplicate model for RTFM won't work, because it needs posts within the community. And yes, most questions posted on tex.se are duplicates and it is good to mark them as such as it will help users to find more information about their problem and encourages users to place their answers in one spot. – samcarter_is_at_topanswers.xyz Feb 27 '24 at 11:52
  • I have to go now, but, again, this question is not a duplicate. If it was, I can tell you that I wouldn't open it. ;) However, I am not a moderator so I will stick to any moderator sentence. I am genuinely interested in the outcome. :D – Barzi2001 Feb 27 '24 at 11:59
  • @samcarter_is_at_topanswers.xyz oh, forgot to mention! You got downvotes! I am too old to care about these internet points, but apparently they are very important here as they give you privileges and such. Although I agree that in many cases closing & linking is a good approach if there is a clear continuity line, in this specific case that would be a sloppy solution in my opinion, given that the questions asked are profoundly different. For this specific case, in my opinion, it is much clear to keep the question open. – Barzi2001 Feb 27 '24 at 12:09

1 Answers1

1

For future users that may end up in installing texlive with Ubuntu and attempt to install packages with tlmgr: you cannot, or at least you should not.

You have two options:

A. You install texlive through Ubuntu. Then, you must use apt (or similar) to manage your texlive installation. For example, and assuming that you are using apt, if you need a specific .cls or .sty, then you must find in which Ubuntu package such files are contained and install it via apt.

B. You install via install-tl script contained in some distribution that you can download via some CTAN. See here for more info. If you take this route, then you should be able to use tlmgr for installing packages.

Barzi2001
  • 477
  • 2
    Note that the apt-file tool is very useful for A, use via first (occationally) sudo apt-file update, then use via apt-file search file.sty and you should be able to determine which apt package provides this latex package. – daleif Feb 27 '24 at 10:54
  • Good to know. Thanks for adding some constructive element to a solution of a general problem that I am sure many already faced/will face. :) – Barzi2001 Feb 27 '24 at 11:05
  • 1
    It would be nice if Debian or whoever would add a message that tlmgr install is not supported in their version. This comes up on the site too often. Especially also a proble as the Linux dists does not update latex packages when new versions are released. – daleif Feb 27 '24 at 11:09
  • That would be great indeed. But I am not sure they will do it :D On the contrary, when people google "how to install latex on Ubuntu" it should be highlighted clearly that they can go two ways in as many ways as possible because it is a serious issue in my opinion. While latex community don't have any control on Debian/whatever devs, they have control on their CTAN, docs, etc. – Barzi2001 Feb 27 '24 at 11:52