Problems compiling LaTeX to pdf


Hi, I recently updated to Fedora 38 from F36* and now I can’t compile LaTeX files or Rmarkdown files (which uses LaTeX) to PDF.

*Actually, this started to happen before I made the upgrade to F38 in Rmarkdown, I’m not sure about TeXStudio though, since I didn’t use it before upgrading but after compiling to pdf in Rmarkdown had stopped working.

Specifically, I’m finding this error::

! pdflatex: error while loading shared libraries: cannot open shared object file: No such file or directory

If I change the compiler to xelatex instead of pdflatex, I still find a very similar error:

error while loading shared libraries: cannot open shared object file: No such file or directory

I’ve noticed that have installed this versions (under /usr/lib/):  

And this one (under /usr/lib64/):

So it appears I have versions more up to date than I should?

I’ve also tried adding the bin paths (/home/username/bin/pdflatex and /home/username/bin/xelatex) to LD_LIBRARY_PATH, but I’m not really sure if that’s helpful at all.

In both cases it appears the library file version number is not provided.

# dnf provides */*
Last metadata expiration check: 3:30:40 ago on Thu 18 May 2023 09:27:10 AM CDT.

log4cxx-0.13.0-3.fc38.x86_64 : A port to C++ of the Log4j project
Repo        : fedora
Matched from:
Filename    : /usr/lib64/
Filename    : /usr/lib64/


 dnf provides */*
Last metadata expiration check: 3:35:36 ago on Thu 18 May 2023 09:27:10 AM CDT.

libicu-72.1-2.fc38.x86_64 : International Components for Unicode - libraries
Repo        : @System
Matched from:
Filename    : /usr/lib64/
Filename    : /usr/lib64/

I only have the 64bit versions installed under /lib/lib64 and I see the libicu* versions for 67, 71, and 72, and do not have the liblog4cxx files at all.

In come cases it is possible to create a local symlink with the needed name within the library to point to the existing library file. It may or may not work.
My system shows this

# ls -l /usr/lib64/libicui18n*
lrwxrwxrwx. 1 root root      18 Jul 22  2021 /usr/lib64/ ->
-rwxr-xr-x. 1 root root 3201088 Jul 22  2021 /usr/lib64/
lrwxrwxrwx. 1 root root      18 Jan 18 18:00 /usr/lib64/ ->
-rwxr-xr-x. 1 root root 3424776 Jan 18 18:00 /usr/lib64/
lrwxrwxrwx. 1 root root      18 Jan 18 18:00 /usr/lib64/ ->
-rwxr-xr-x. 1 root root 3437352 Jan 18 18:00 /usr/lib64/

I use Rstudio and rmarkdown, but with the Fedora 38 packages for TeX Live and with CTAN TeX Live 2023. The CTAN binaries are statically linked, so should not generate errors loading shared libraries. You appear to be using different binaries. Is there a reason you can’t use the Fedora 38 texlive packages?

No other reason than not being able to get it to work, haha.

I have the TeX Live packages, I’m not sure if I have the CTAN binaries. If they also get installed when you install TeX Live, then I have them, otherwise I don’t.

How do you use them in RStudio? I’ve looked around the setting but I can only use pdflatex and xelatex (both fail). I read you can also set a custom one using the RSTUDIO_PDFLATEX environment variable, but I’m not sure how to do that. Do I put the path to the CTAN binaries there?

I use lualatex as the long term future of xetex and pdftex seem uncertain while lualatex has very active development. Rmarkdown Advanced Customization shows how to specify the LaTeX program.

My Fedora boxes are down — just coming out of a power outage in my town — but reasonably sure Fedora builds the TeX Live binaries for their packages from the CTAN sources.

I think anyone using latex can have full features from the fedora packages. There are, after all, more than 6000 latex and texlive packages available directly from fedora.

Of those it seems more than 100 are directly related to xelatex or pdflatex.

Yes, Fedora packages are a rebuild of the TeXlive distribution, often “somewhat behind” in version.

I suggest not to mix Fedora packages (dnf) with a local TeXlive installation (tlmgr). Using Fedora packages (for TeXlive, TeXStudio, RStudio) should give you the best integration.

As soon as you compile packages locally (e.g. by installing TeXlive locally) you will have to take care of rebuilds etc. manually. Apparantly this is what happended here: some local install of pdflatex that got out of date with the present libraries.

If you plan to build Fedora rpms that have TeX documantation you should stick with the Fedora

The CTAN TeX Live (TL) packages are statically linked. You can easily switch between Fedora and CTAN TL using the Lmodpackage, (used to switch between mpi/mpich-x86_64 and mpi/openmpi-x86_64. Try running ml avail in a terminal.)

TL is a large with many interdependencies, so it is a lot work to maintain outside distro packages or CTAN TL. For R users, there is R-tinytex.noarchbased on CTAN TL and intended to provide just what is required for R.

Well. I finally solved it by just uninstalling miktex. Which in hindsight, I probably should’ve done that way sooner.

Anyway, thanks everyone for the responses!