0

I use Ubuntu MATE 18.04 LTS with installed R and RStudio to build bookdown books and documents.

Previously I used these applications in 16.04 LTS.
Building/knitting book or single RMarkdown document to odt/docx ended here by showing the document in LibreOffice Writer.

In 18.04 LTS the behavior is changed.
Knitting document or book to odt/docx does not show the document in LibreOffice.

If I launch RStudio from the terminal and hit Knit or Build Book it shows the following output:

/usr/lib/libreoffice/program/javaldx: error while loading shared libraries: libreglo.so: cannot open shared object file: No such file or directory
Warning: failed to read path from javaldx
/usr/lib/libreoffice/program/soffice.bin: error while loading shared libraries: libreglo.so: cannot open shared object file: No such file or directory

How can I fix this?


The libreglo.so is really in place:

$ dpkg -S libreglo.so
uno-libs3: /usr/lib/libreoffice/program/libreglo.so

Libreoffice Java binding is in place

$ dpkg -l libreoffice-java-common | tail -n1
ii  libreoffice-java-common 1:6.0.7-0ubuntu0.18.04.10 all          office productivity suite -- arch-independent Java support files

$ update-java-alternatives -l
java-1.11.0-openjdk-amd64      1111       /usr/lib/jvm/java-1.11.0-openjdk-amd64

Enabling/disabling Java in loffice, ToolsOptions, LibreOffice, Advanced, [ ] Use a Java runtime environment does not change anything.

0

To fix the problem we need to add the following line with LD_LIBRARY_PATH at the end of ~/.profile and to ~/.bashrc:

export LD_LIBRARY_PATH="/usr/lib/libreoffice/program:$LD_LIBRARY_PATH"

and to rstudio.desktop launcher:

mkdir -p ~/.local/share/applications/
cp /usr/share/applications/rstudio.desktop ~/.local/share/applications/
sed -i "s|/usr/lib/rstudio/bin/rstudio|env LD_LIBRARY_PATH=/usr/lib/libreoffice/program /usr/lib/rstudio/bin/rstudio|"  ~/.local/share/applications/rstudio.desktop

Note: this method is also applicable to Ubuntu 20.04 LTS and 20.10.

1
  • /usr/lib is one of the places the dynamic linker looks at for libs. Would be better to find out why it's not in the search path and fix that. – P.P Jul 11 '20 at 11:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.