Error message installing package

Hello everyone, I have a question about an error message I have received.

I have tried to install the package "SNPRelate" with Biocmanager using this command:


And the error message in return was:

/usr/bin/ld: final link failed: memory exhausted
collect2: error: ld returned 1 exit status
make: *** [/usr/share/R/share/make/] Error 1
ERROR: compilation failed for package ‘gdsfmt’

  • removing ‘/home/toaster2000/R/x86_64-pc-linux-gnu-library/4.0/gdsfmt’
    ERROR: dependency ‘gdsfmt’ is not available for package ‘SNPRelate’
  • removing ‘/home/toaster2000/R/x86_64-pc-linux-gnu-library/4.0/SNPRelate’

The downloaded source packages are in
Installation paths not writeable, unable to update packages
path: /usr/lib/R/library
boot, class, cluster, foreign, lattice, MASS, Matrix, mgcv, nlme, nnet, rpart, spatial, survival
Warning messages:
1: In .inet_warning(msg) :
installation of package ‘gdsfmt’ had non-zero exit status
2: In .inet_warning(msg) :
installation of package ‘SNPRelate’ had non-zero exit status

My questions are:

What does it mean "Installation paths not writeable"? Should I use a sudo command as in BASH?

What is the "final link failed: memory exhausted"? Does it mean that my local computer is not powerful enough to install this package?

Thanks for your help!

It means that your user has no write permissions on that folder, whereas you could run an R command with sudo from the terminal like sudo su - -c "R -e \"update.packages(checkBuilt = TRUE)\"" , I think it would be better on the long run to modify the folder permissions instead, you could use 770 and add your user to the root group or whatever makes sense for your setup as long as it allows your user to write on that folder.

We don't have enough information to tell for sure but it could mean that you are running out of RAM memory, if that is the case, you could walk around this by adding swap memory but it would be considerably slower compared to adding (or provisioning) more RAM.

I agree with @andresrcs assessment of the memory exhausted message - however I would advise against changing the global R installation. BiocManager::install()has the tendency trying to upgrade all packages including the core R packages. The inability to upgrade those core R packages however will not lead to any functionality impact at all. Hence I would consider this more like a warning.

This is especially true on a system where the R installation is shared with other users as well - you don't want to upgrade R packages in the shared path in /usr/lib and then have people shouting at you that their code suddenly does not work any more or produce different results.

Bottom line: Make sure you get more RAM (maybe clean up your session or start a fresh one) and that's all you can/need to do IMHO to install the package.

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.