Hi,
I am used to open pdf cheatsheets directly from the RStudio terminal with the command open.
I recently upgraded Ubuntu 22.04 to Ubuntu 24.04 and after this, the open command gives this error:
/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
However, opening the pdf file with the command open works fine when using the terminal of Ubuntu.
Is there something I can do to solve this problem?
Thanks
Thanks for your response. the file was set to only reading. I set it to read-write but the problem persists. What is intriguing is that the default application for opening pdf files is the document viewer of Ubuntu (evince), not libreoffice.
I wondered about the involvement of libreoffice. It might be used if a PDF were being opened for editing as opposed for reading. What is the exact command (including all arguments) that produces the error messages?
open ../bibliografia\ para\ R/CHEATSHEETS/stringr.pdf
the path takes into account that I'm in the pwd of the R project. stringr.pdf is just an example, it happens with every file, even with LibreOffice documents.
This only happens with the terminal in RStudio. Using the open command from the OS terminal won't give any error. I don't use any arguments.
Thanks
Thanks for your response.
Actually, if I go to the folder where the cheat-sheets are and run the open command I get the same error
cd . ./bibliografia\ para\ R/CHEATSHEETS/
open stringr.pdf
There is a .profile file in the home directory. I created an alias in this file to open the stringr.pdf . It did not give the error, but instead of opening the stringr.pdf file, it opens the file browser positioned in the cheatsheet folder.
I couldn´t upload the .profile file but here is the content:
# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.
# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022
# if running bash
if [ -n "$BASH_VERSION" ]; then
# include .bashrc if it exists
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
fi
fi
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/.local/bin" ] ; then
PATH="$HOME/.local/bin:$PATH"
fi
alias stringr='open ../bibliografia\ para\ R/CHEATSHEETS/'
I am just an RStudio-R end-user, so I get mixed up with the configuration files and paths. I don't quite understand the meaning of each line, but I might think that here is the problem. There is another configuration file in the home directory named .bashrc, this is the file where I normally put the aliases for opening the cheatsheets. Unfortunately, if I remove the .profile file and source the .bashrc, when invoking the alias I get the same error
I'm running Mint 22 (based on Ubuntu 24.04) and RStudio 2024.09.0. When I type open /home/paul/.../myfile.pdf in the RStudio terminal, it opens the file in Xreader, which is the default PDF reader in Mint. There are one or two harmless messages in the terminal but no problems. So I don't think it's an RStudio issue. Maybe an issue with how open works in different OSes?
Considering that open works fine in the Ubuntu terminal, then I suspect that there is something in the RStudio bash configuration that creates the problem. Anyway, it seems that we won't be able to come up with a solution, right?
Since the problem began after an OS upgrade rather than an RStudio upgrade, I'm inclined to think that something in the system configuration is the culprit (but no idea what). As one last long-shot, you could try resetting RStudio's state (saving the old state stuff so that you can restore it if the reset fails to solve the problem).
Updating/reinstalling RStudio does not reset the desktop state, but apparently that is not the culprit here. It might be interesting to execute xdg-mime query default application/pdf in the RStudio terminal and see what application open should be running to open a .pdf file. The correct response presumably should be evince on your system (xreader on mine). If it does answer evince, you could try xdg-mime query filetype <path to your PDF file> to verify that the RStudio terminal groks that the file is a PDF file (correct response "application/pdf").