0

I run an Arch system and used the Texlive-distribution provided by the distribution package manager. However, now I encountered a bug and decided to switch to a native Texlive installation, which I installed. I added /usr/local/texlive/2023/bin/x86_64-linux to the PATH as the install script said, and similar for MANPATH and INFOPATH, and I can run tlmgr in the terminal, but it seems latex hasn't picked up on the PATH-change, since, if I try to compile something, I get the following error message:

warning: kpathsea: configuration file texmf.cnf not found in these directories: /usr/bin:/usr/bin/share/texmf-local/web2c:/usr/bin/share/texmf-dist/web2c:/usr/bin/share/texmf/web2c:/usr/bin/texmf-local/web2c:/usr/bin/texmf-dist/web2c:/usr/bin/texmf/web2c:/usr:/usr/share/texmf-local/web2c:/usr/share/texmf-dist/web2c:/usr/share/texmf/web2c:/usr/texmf-local/web2c:/usr/texmf-dist/web2c:/usr/texmf/web2c://texmf-local/web2c:/://share/texmf-local/web2c://share/texmf-dist/web2c://share/texmf/web2c://texmf-local/web2c://texmf-dist/web2c://texmf/web2c.
This is LuaHBTeX, Version 1.17.0 (TeX Live 2023/Arch Linux) 
 system commands enabled.

kpathsea: Running mktexfmt lualatex.fmt mktexfmt: No such file or directory I can't find the format file `lualatex.fmt'!

I can find texmf.cnf in /usr/local/texlive/2023/ and /usr/local/texlive/2023/texmf-dist/web2c/ and lualatex.fmt in /usr/local/texlive/2023/texmf-var/web2c/luahbtex/lualatex.fmt, but apparently kpathsea can't. How can I re-configure Latex to the new location of my Texlive-installation? I tried

export TEXMF=:/usr/local/texlive/2023
export TEXMF=:/usr/local/texlive/2023/texmf-dist
export TEXINPUTS=/usr/local/texlive/2023//

but none of them worked.

  • 1
    where did you put those exports, and have you logged in again (or otherwise forced the file to load) on the terminal type tex should give your texlive/2023 path (assuming bash) or which tex don't set TEXMF or TEXINPUTS (certainly not to those values) just set PATH – David Carlisle Oct 03 '23 at 10:32
  • @DavidCarlisie I haven't tried to log out and in again, but I have sourced from /etc/profile, where I configured the path. Typing tex gives the same error message. – Alexander Praehauser Oct 03 '23 at 10:37
  • 1
    This is LuaHBTeX, Version 1.17.0 (TeX Live 2023/Arch Linux) is the system tex not the texlive 2023 from tug you installed. – David Carlisle Oct 03 '23 at 10:44
  • Did you uninstall the packaged TL version? – lukeflo Oct 03 '23 at 10:48
  • @DavidCarlisie I logged out and in again, the error persists. type tex also points to /usr/bin/tex, not the new texlive install. It's no wonder it can't find anything there because I uninstalled the system texlive packages in hopes of avoiding something like this. – Alexander Praehauser Oct 03 '23 at 10:48
  • @lukeflo Yes, but it still seems to point towards it. – Alexander Praehauser Oct 03 '23 at 10:49
  • so you have not set the PATH to put /usr/local/texlive/2023/bin/x86_64-linux at the front. What does echo $PATH say? – David Carlisle Oct 03 '23 at 10:50
  • @DavidCarlisle /home/alex/.local/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/local/texlive/2023/bin/x86_64-linux:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl – Alexander Praehauser Oct 03 '23 at 10:52
  • so you are prefering the system tex in /usr/local/bin to the upstream tex in /usr/local/texlive. move the upstream one earlier – David Carlisle Oct 03 '23 at 10:53
  • @DavidCarlisle I've reconfigured it so PATH is now /usr/local/texlive/2023/bin/x86_64-linux/bin:/usr/bin:/usr/local/sbin:/usr/local/bin::/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl but the error persists. – Alexander Praehauser Oct 03 '23 at 11:09
  • @DavidCarlisle I discovered an error in the above: there should have been a : after x86_64-linux. I've corrected it. The previous error is gone, but now I get lstat(./tex) failed: ./tex: No such file or directory kpathsea: Can't get directory of program name: ./tex. – Alexander Praehauser Oct 03 '23 at 11:12
  • so if you run luahbtex it can not now give the log you show (using (TeX Live 2023/Arch Linux) it should show This is LuaHBTeX, Version 1.17.0 (TeX Live 2023) – David Carlisle Oct 03 '23 at 11:12
  • 1
    why are you running ./tex ? – David Carlisle Oct 03 '23 at 11:13
  • @DavidCarlisle I tried latex on a test file, it gave me now the same warning as before twice. It also says /usr/local/texlive/2023/bin/x86_64-linux/mktexfmt: kpsewhich -var-value=TEXMFROOT failed, aborting early. BEGIN failed--compilation aborted at /usr/local/texlive/2023/bin/x86_64-linux/mktexfmt line 25. I can't find the format filelatex.fmt'!``. About the version it says This is pdfTeX, Version 3.141592653-2.6-1.40.25 (TeX Live 2023/Arch Linux) (preloaded format=latex). ` – Alexander Praehauser Oct 03 '23 at 11:18
  • that's the system pdftex not upstream texlive, sorry I can't help more. – David Carlisle Oct 03 '23 at 11:24
  • @DavidCarlisle Alright, thanks anyway. I'll write to the texlive mailing list. – Alexander Praehauser Oct 03 '23 at 11:28
  • have you made sure to remove those TEXMF settings from your environment? (not just remove them from your /etc/profile) – David Carlisle Oct 03 '23 at 11:29
  • I didn't put them into /etc/profile but only set them via terminal before I logged out and in again, so I think they should be gone. echo $TEXMF returns nothing. – Alexander Praehauser Oct 03 '23 at 11:36
  • What's the output of kpsewhich -var-value TEXMFDIST or kpsewhich -var-value TEXMFMAIN? echo $TEXMF always returns nothing. – lukeflo Oct 03 '23 at 11:52
  • @DavidCarlisle I found the problem. When I corrected for the missing semicolon after prepending /usr/local/texlive/2023/bin/x86_64-linux to PATH I created another grammar error. Now that I corrected it, it works. Thanks again! – Alexander Praehauser Oct 03 '23 at 12:06
  • @lukeflo Thanks, but the solution was actually just prepending /usr/local/texlive/2023/bin/x86_64-linux to PATH, it was just that I made another error in grammar when I did that. – Alexander Praehauser Oct 03 '23 at 12:08
  • Note: TeX Live is wrong about MANPATH. On Arch, at least, it should be empty. – cfr Oct 03 '23 at 17:48

1 Answers1

0

I found the solution thanks to a lot of help by David Carlisle. The system was still trying to find the distribution-provided Texlive-installation, which I had uninstalled, because I added /usr/local/texlive/2023/bin/x86_64-linux to PATH after /usr/bin. In such a case one has to add /usr/local/texlive/2023/bin/x86_64-linux to path before /usr/bin, which I did with this variant of the append_path-function that is in /etc/profile:

# Prepend "$1" to $PATH when not already in.
# This function API is accessible to scripts in /etc/profile.d
prepend_path () {
    case ":$PATH:" in
        *:"$1":*)
            ;;
        *)
            PATH="$1:${PATH:+$PATH:}"
    esac
}
  • You clearly had not uninstalled Arch's distribution. Very likely, you still haven't. This is obvious from the log posted in your question. If you'd really uninstalled it, it wouldn't matter you'd put the new path later in PATH. (That's not to say it isn't best to put it at the front, but just that it wouldn't matter if you really had cleaned Arch's texlive packages out.) – cfr Oct 03 '23 at 17:51
  • @cfr Well, I told pacman to uninstall it, typed y when it asked me to confirm and when I later checked whether it was installed pacman told me that it wasn't. I don't know what else I was supposed to do, but I certainly did that. – Alexander Praehauser Oct 03 '23 at 17:54
  • Without knowing exactly what commands you used, it's impossible to say. But the log you posted clearly shows the Arch binary on your system. That's why David said it was your distro's installation and not the new TeX Live one. Note that, even if you uninstalled it, you may have reinstalled it afterwards without noticing. Unless you install a 'dummy' package, all kinds of things will pull in Arch's packaged TL. For example, if you install an editor, it will typically pull the whole caboodle back in. You also don't say what you uninstalled. It is not a single package. – cfr Oct 03 '23 at 17:58
  • @cfr I'm pretty sure I used yay -Rcc texlive. I also didn't have it installed at least as far as pacman/yay was concerned because I have since reinstalled sagetex, which had texlive-basic in its dependencies (as well as some other stuff) and these all got newly installed. Also, if it had not been uninstalled I think now a latex compilation would have run the packaged livetex-version and not found none at all. – Alexander Praehauser Oct 03 '23 at 18:05
  • As David explained in https://tex.stackexchange.com/questions/697513/re-configuring-latex-path-after-switching-from-distribution-provided-texlive-to/697517?noredirect=1#comment1732549_697513, the error you posted clearly shows it not only found some of the Arch TeX binaries, but ran them. You uninstalled enough to break Arch's installation, but you left a chunk behind. You can find out precisely what you uninstalled by looking in pacman's log. I don't use yay, but there is no texlive package in Arch's repositories. – cfr Oct 03 '23 at 19:44
  • @cfr I'm pretty sure yay just sends an -Rcc command to pacman if no packages in the AUR are involved. If you type sudo pacman -Rcc texlive you can see for yourself that pacman uninstalls in such a case every package containing texlive in its name, as well as all packages depending on them and every otherwise unused dependency. It doesn't matter now, but whatever the problem was, it wasn't because I didn't uninstall texlive but maybe because pacman left something it shouldn't have. – Alexander Praehauser Oct 04 '23 at 13:59
  • Er ... that's not true. pacman -Rcc -p texlive returns an error because no target package is found, even though pacman -Qs texlive returns texlive-dummy-cfr. As you say, you can try it for yourself. It targets packages called 'texlive' - not packages with 'texlive' in their names. Also, I'm not sure the second c does anything. It doesn't seem to be documented, at least. (-p to print the list rather than actually remove stuff, obviously.) – cfr Oct 04 '23 at 16:26
  • @cfr Well, I didn't add the -p flag, and I did try it out, before and just now, and at least on my system sudo pacman -Rcc texlive proposes the removal of all texlive packages I have installed as dependencies for sagetex. You're right about the second c though, I think I wanted to do -Rsc and got it confused with cache cleaning. Still, it did delete 3GB worth of texlive files. – Alexander Praehauser Oct 04 '23 at 18:32
  • I suspect it is acting on the group and that the names have nothing to do with it. Having Arch packages installed may cause issues, so be alert to that possibility. (It should be possible, but you're probably installing 3G of stuff you won't use as sagetex could equally use what's in /usr/local. – cfr Oct 04 '23 at 21:40
  • @cfr The 3GB were just when I first uninstalled texlive, sagetex with its dependencies is only 60mb. But you're right, that is clutter, I just reinstalled it to have it update automatically. – Alexander Praehauser Oct 04 '23 at 23:13
  • 1
    If you install a dummy package, pacman will believe you've installed TeX Live and will keep sagetex etc. updated without bringing 3G with it. Personally, I find that solution cleaner and more reliable, but you can obviously keep both if you prefer. In case you're interested, I posted my PKGBUILD recently in response to another question (https://tex.stackexchange.com/a/696839/). – cfr Oct 04 '23 at 23:17