# TeX Live and Fedora

I’ve been using TeX Live on Fedora for years, but today I encountered an odd error when trying to perform the usual `sudo tlmgr update package`. I tried an Internet search of the error message but it didn’t provide any helpful clues. I finally worked out what had happened and, since it’s possible someone else might stumble on the same thing, I thought it might be useful to post about it in case it helps others.

First a little background information to supply some context. I normally use `dnf` to install or update software on Fedora, but not when it comes to TeX because I have found in the past that the Linux distros tend to have outdated TeX packages. Instead, I install TeX Live from the DVD (which I automatically receive as a joint member of UK TUG and TUG) as I have an iffy broadband connection, and I also have to update the TeX Live distributions for other family members. It’s easy to slap the DVD in the drive and set the installer going regardless of whether the computer has Linux or Windows. On my own device, I keep the TeX Live installations from the previous couple of years as it’s useful to be able to switch to an older version when trying to investigate a bug that has appeared with a new TeX Live release. (I have a symbolic link `/usr/local/texlive/default` that points to the release I want to use. All I need to do is change the link to switch to a different release.)

I don’t like automatic updates (it can be confusing if an update occurs without my noticing and causes an unexpected conflict) so I just periodically run `sudo tlmgr update --all` but today this resulted in an unexpected error. (The message suggests it’s a warning but the process fails.)

```*** WARNING ***: Performing this action will likely destroy the Fedora TeXLive install on your system.
*** WARNING ***: This is almost NEVER what you want to do.
*** WARNING ***: Try using dnf install/update instead.
*** WARNING ***: If performing this action is really what you want to do, pass the "ignore-warning" option.
*** WARNING ***: But please do not file any bugs with the OS Vendor.
```

As is often the case, the problem is obvious in hindsight but it flummoxed me for a while. Why was the TeX Live manager suddenly telling me to use `dnf` when I’d installed it from the DVD? It had worked fine the last time (not that long ago), so what had changed since then? A few days ago I’d upgraded to Fedora 31.

It turned out that I now have an extra TeX Live installation that I didn’t know about in `/usr/share/texlive/` with its own `tlmgr` in `/bin` (which is a symbolic link to `/usr/bin`). To add to the confusion my normal user PATH has `/usr/local/texlive/default/bin/x86_64-linux` near the start of the list but the `/etc/sudoers` file had it at the end:

```Defaults    secure_path = /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/texlive/default/bin/x86_64-linux
```

This means that when I use TeX as a normal user it’s picking up the installation from the DVD, but with sudo it’s picking up the other installation, which requires `dnf` rather than `tlmgr` to update TeX packages. The question is, how did that other TeX Live installation suddenly appear?

Some years ago I installed `texlive-dummy` to satisfy dependencies in the event that I had to install software that required a TeX distribution. As far as I can tell, that `texlive-dummy` RPM no longer exists. My guess is that when I upgraded to Fedora 31, the upgrade process detected the TeX Live dependency, but `texlive-dummy` had disappeared, so it installed the complete TeX Live distribution instead. For now, I’ve simply edited the `/etc/sudoers` file so that `/usr/local/texlive/default/bin/x86_64-linux` is listed first in the path.