Strange error when trying to install packages

Hi, everyone!

I'm on Lubuntu 20.04 with R v.4.0 and RStudio v.1.3.1093
I have many issues trying to install some packages, like tidyverse, and learnr. I am about to start a course and I need this packages, and others already installed.

Please someone help me understand.

This is the error I get, which I do not know how to troubleshoot:

Error: package or namespace load failed for ‘tidyr’ **in dyn.load(file, DLLpath = DLLpath, ...):**
** unable to load shared object** '/mnt/Alonso/R/library/00LOCK-tidyr/00new/tidyr/libs/tidyr.so':
  /mnt/Alonso/R/library/00LOCK-tidyr/00new/tidyr/libs/tidyr.so: failed to map segment from shared object
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/mnt/Alonso/R/library/tidyr’
Warning in install.packages :
  installation of package ‘tidyr’ had non-zero exit status
ERROR: dependency ‘tidyr’ is not available for package ‘broom’
* removing ‘/mnt/Alonso/R/library/broom’
Warning in install.packages :
  installation of package ‘broom’ had non-zero exit status
ERROR: dependencies ‘broom’, ‘tidyr’ are not available for package ‘modelr’
* removing ‘/mnt/Alonso/R/library/modelr’
Warning in install.packages :
  installation of package ‘modelr’ had non-zero exit status
ERROR: dependencies ‘broom’, ‘lubridate’, ‘modelr’, ‘tidyr’ are not available for package ‘tidyverse’
* removing ‘/mnt/Alonso/R/library/tidyverse’
Warning in install.packages :
  installation of package ‘tidyverse’ had non-zero exit status

Why do I have a DLL issue if I'm on Ubuntu??? (from the first line)

And this is my /etc/R/Renviron file, just in case:

### etc/Renviron.  Generated from Renviron.in by configure.
###
### ${R_HOME}/etc/Renviron
###
### Record R system environment variables.

## As from R 4.0.0 the C code reading this follows the POSIX rules
## for parameter substitution in shells, section 2.6.2 of
## https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18
## In earlier versions ${FOO-bar} was interpreted the same as ${FOO:-bar}

R_PLATFORM=${R_PLATFORM-'x86_64-pc-linux-gnu'}
## Default printer paper size: first record if user set R_PAPERSIZE
R_PAPERSIZE_USER=${R_PAPERSIZE-'letter'}
R_PAPERSIZE=${R_PAPERSIZE-'letter'}
## Default print command
R_PRINTCMD=${R_PRINTCMD-'/usr/bin/lpr'}
# for Rd2pdf, reference manual
R_RD4PDF=${R_RD4PDF-'times,inconsolata,hyper'}
## used for options("texi2dvi")
R_TEXI2DVICMD=${R_TEXI2DVICMD-${TEXI2DVI-'/usr/bin/texi2dvi'}}
## used by untar(support_old_tars = TRUE) and installing grDevices
R_GZIPCMD=${R_GZIPCMD-'/bin/gzip -n'}
## Default zip/unzip commands
R_UNZIPCMD=${R_UNZIPCMD-'/usr/bin/unzip'}
R_ZIPCMD=${R_ZIPCMD-'/usr/bin/zip'}
R_BZIPCMD=${R_BZIPCMD-'/bin/bzip2'}
## Default browser
R_BROWSER=${R_BROWSER-'xdg-open'}
## Default editor
EDITOR=${EDITOR-${VISUAL-vi}}
## Default pager
PAGER=${PAGER-'/usr/bin/pager'}
## Default PDF viewer
R_PDFVIEWER=${R_PDFVIEWER-'/usr/bin/xdg-open'}
## Used by libtool
LN_S='ln -s'
MAKE=${MAKE-'make'}
## Prefer a POSIX-compliant sed on e.g. Solaris
SED=${SED-'/bin/sed'}
## Prefer a tar that can automagically read compressed archives
TAR=${TAR-'/bin/tar'}

## System and compiler types.
R_SYSTEM_ABI='linux,gcc,gxx,gfortran,gfortran'

## Strip shared objects and static libraries.
R_STRIP_SHARED_LIB=${R_STRIP_SHARED_LIB-'strip --strip-unneeded'}
R_STRIP_STATIC_LIB=${R_STRIP_STATIC_LIB-'strip --strip-debug'}

R_LIBS_USER=${R_LIBS_USER-'/mnt/Alonso/R/x86_64-pc-linux-gnu-library/4.0'}
#R_LIBS_USER=${R_LIBS_USER-'~/Library/R/4.0/library'}

# edd Apr 2003  Allow local install in /usr/local, also add a directory for
#               Debian packaged CRAN packages, and finally the default dir 
# edd Jul 2007  Now use R_LIBS_SITE, not R_LIBS
R_LIBS_SITE=${R_LIBS_SITE-'/usr/local/lib/R/site-library:/usr/lib/R/site-library:/usr/lib/R/library:/mnt/Alonso/R/x86_64-pc-linux-gnu-library/4.0'}

### Local Variables: ***
### mode: sh ***
### sh-indentation: 2 ***
### End: ***

Please note that I have a custom route in R_LIBS_SITE and R_LIBS_USER variables.

This may be a permissions issue

I thought so at first, but I am sure that the directory is owned by my user and read/write permissions are enabled:


$ ls -al /mnt/Alonso/R/x86_64-pc-linux-gnu-library/4.0
total 8
drwxrwxr-x 2 lobaluna lobaluna 4096 oct  8 17:37 .
drwxrwxr-x 4 lobaluna lobaluna 4096 oct  7 20:52 ..

Please do not take into account my last comment. You are my new hero. I read permissions, an d I thought the usual permissions. Then I clicked in the link, payed attention, did my corrections to the noexec limitation of the file system (when mounted), and finally I was able to compile correctly!!!!

All the time it was this self-limitation of the filesystem.

I have to say that the error messages is kind of misleading.

THANK YOU very much, @technocrat. You have a fan here!

I am not going to erase my wrong answer so anybody else can understand the problem correctly.

1 Like

Is it mounted with noexec ? If so, then R won't be able to load the package. (per This may be a permissions issue)

Yes, it is the partition /mnt/Alonso which was mounted with the noexec permission.

1 Like

This topic was automatically closed 7 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.