error while loading shared libraries:


I installed RStudio server on a CentOS7 machine with R using precompiled version provided by RStudio. Originally I ried installing R from source, but then found the precompiled version (R-4.0.3-1-1.x86_64) which I installed. R is working and I have packages installed (including tidiverse)

However, I cannot get the server to work because unfortunately, when running the following command I get an error

> sudo rstudio-server verify-installation
/usr/lib/rstudio-server/bin/rsession: error while loading shared libraries: cannot open shared object file: No such file or directory

I have spent hours trying to figure out what's wrong, but all the options I see are related to the source version which needs to be compiled (i.e. --enable-R-shlib which I don't have as an option when using precompiled)

This is not helping...

I really don't know how to fix this. I reinstalled the server but the problem stays, it seems I just dont have this shared library...


I would try compiling R from source, with ./configure --enable-R-shlib, I have never used RHEL based Linux distributions but in case it helps, these would be the steps for Debian based OS'.

sudo apt-get install -y gfortran libreadline6-dev libx11-dev libxt-dev \
                               libpng-dev libjpeg-dev libcairo2-dev xvfb \
                               libbz2-dev libzstd-dev liblzma-dev \
                               libcurl4-openssl-dev \
                               texinfo texlive texlive-fonts-extra \
                               screen wget libpcre2-dev
cd /usr/local/src
sudo wget
sudo su
tar zxvf R-4.0.3.tar.gz
cd R-4.0.5
./configure --enable-R-shlib #--with-blas --with-lapack
make install
cd ..
rm -rf R-4.0.5*


Thanks for the quick reply
I have tried this but I'm on CentOS7 and trying to install R from source did not work unfortunately.

I have installed it successfully on another similar machine and it's working perfectly, but somehow I did mess things up I can't get this to work anymore regardless of un- or reinstalling so I suspect that somewhere a setting got messed up ...

Hopefully someone else has some more ideas...


It should work since R is compatible with RHEL, maybe if you share the specific error message you get someone could figure out what the problem is.


Yea the only message I get is the one you can see in my first post. Unfortunately, the path to the missing library file ( is not set, so I have no clue how to start fixing this. There is a file in my standard R library (/opt/R/4.0.2/lib/R/lib) but that does not seem to be enough...

Thanks again for thinking out loud and trying to give tips


Maybe I misunderstood your previous comment, just to clarify, do you have successfully compiled R from source with the --enable-R-shlib option and RStudio Server still doesn't work?


Yes I did manage to compile the latest version with --enable-R-shlib and still no luck ...

Do you change LD_LIBRARY_PATH in your profile scripts? Can you try with rsession-no-profile=1 ​ in rserver.conf ?


Thanks for the tip, but unfortunately it's giving me an error again:

> sudo rstudio-server verify-installation
Error reading /etc/rstudio/rserver.conf: unrecognised option 'rsession-no-profile'

conf file

# Server Configuration File



That is surprising. Which version of RStudio Server Pro are you using?


I'm not using the pro version, just the basic one. Sorry for the confusion...


Ok. That explains the error message. So we have viewer tools to work with ...

So your R version is installed in /opt/R/4.0.5/. I assume that /opt/R/4.0.5/lib/R/lib/ exists. What is the output of

ldd /opt/R/4.0.5/lib/R/lib/

? Are there any missing libraries?


It is complicated, since I have installed multiple versions of R in different ways to try and solve this issue.

R 4.0.5 - installed by compiling from source

> ldd /opt/R/4.0.5/lib/R/lib/
ldd: /opt/R/4.0.5/lib/R/lib/ No such file or directory

> ls /opt/R/4.0.5
bin  lib64  share

> ldd /opt/R/4.0.5/lib64/R/lib/ =>  (0x00007ffee34d8000) => /usr/lib64/R/lib/ (0x00007f33ee37a000) => /lib64/ (0x00007f33ee058000) => /lib64/ (0x00007f33edd56000) => /lib64/ (0x00007f33edb1a000) => /lib64/ (0x00007f33ed8a3000) => /lib64/ (0x00007f33ed67d000) => /lib64/ (0x00007f33ed46d000) => /lib64/ (0x00007f33ed257000) => /lib64/ (0x00007f33ed04f000) => /lib64/ (0x00007f33ece4b000) => /lib64/ (0x00007f33ecad2000) => /lib64/ (0x00007f33ec6d3000) => /lib64/ (0x00007f33ec4ad000) => /lib64/ (0x00007f33ec291000) => /lib64/ (0x00007f33ebec3000)
        /lib64/ (0x00007f33f0f07000) => /lib64/ (0x00007f33ebcad000) => /lib64/ (0x00007f33ea6da000) => /lib64/ (0x00007f33ea3d2000)

R 4.0.3 - installed from precompiled version

> ldd /opt/R/4.0.3/lib/R/lib/ =>  (0x00007ffe45f93000) => /usr/lib64/R/lib/ (0x00007f8ff4602000) => /lib64/ (0x00007f8ff42e0000) => /lib64/ (0x00007f8ff3fde000) => /lib64/ (0x00007f8ff3da2000) => /lib64/ (0x00007f8ff3b5c000) => /lib64/ (0x00007f8ff38e5000) => /lib64/ (0x00007f8ff36bf000) => /lib64/ (0x00007f8ff34af000) => /lib64/ (0x00007f8ff3299000) => /lib64/ (0x00007f8ff3091000) => /lib64/ (0x00007f8ff2e8d000) => /lib64/ (0x00007f8ff2b14000) => /lib64/ (0x00007f8ff2715000) => /lib64/ (0x00007f8ff24ef000) => /lib64/ (0x00007f8ff22d3000) => /lib64/ (0x00007f8ff1f05000)
        /lib64/ (0x00007f8ff7191000) => /lib64/ (0x00007f8ff1cef000) => /lib64/ (0x00007f8ff1ac5000) => /lib64/ (0x00007f8ff04f2000) => /lib64/ (0x00007f8ff01ea000)

I tried setting either version as the standard one in the Server Configuration File though I get the same message...


How are you actually enabling these different R versions? Above you mentioned rsession-which-r=/opt/R/4.0.5/ in rserver.conf. Have you tried setting that variable to full path of the actual R binary, i.e. something like /opt/R/4.0.5/lib64/R/bin/R? Or to add the right R to the front of the PATH?

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.