Error installing R packages

Hello, I am trying to run an R script from last year, but I get the following error:

Warning in install.packages("nsga2R") :

  • 'lib = "/shared/ifbstor1/software/miniconda/envs/r-4.0.0/lib/R/library"' is not writable*
    Error in install.packages("nsga2R") : unable to install packages
    Execution halted

So I tried to install it directly in Rstudio (, but I got these errors:

Error: package or namespace load failed for ‘mco’:

  • package ‘mco’ was installed before R 4.0.0: please re-install it*
    Error: package ‘mco’ could not be loaded
    Execution halted
    ERROR: lazy loading failed for package ‘nsga2R’
    ** removing ‘/shared/ifbstor1/home/enovoa/R/x86_64-conda_cos6-linux-gnu-library/3.6/nsga2R’*
    ** restoring previous ‘/shared/ifbstor1/home/enovoa/R/x86_64-conda_cos6-linux-gnu-library/3.6/nsga2R’*
    Warning in install.packages :
  • installation of package ‘nsga2R’ had non-zero exit status*

The downloaded source packages are in

  • ‘/tmp/Rtmp3NNEKw/downloaded_packages’*

As a final attempt, I tried to install the package I am trying to use (which requires "nsga2R") directly from Bioconductor, but again, I got some errors:

ERROR: configuration failed for package ‘RJSONIO’
** removing ‘/shared/ifbstor1/home/enovoa/R/x86_64-conda_cos6-linux-gnu-library/3.6/RJSONIO’*
ERROR: dependency ‘RJSONIO’ is not available for package ‘RCy3’
** removing ‘/shared/ifbstor1/home/enovoa/R/x86_64-conda_cos6-linux-gnu-library/3.6/RCy3’*
ERROR: dependency ‘RCy3’ is not available for package ‘MOGAMUN’
** removing ‘/shared/ifbstor1/home/enovoa/R/x86_64-conda_cos6-linux-gnu-library/3.6/MOGAMUN’*

The downloaded source packages are in

  • ‘/tmp/Rtmp3NNEKw/downloaded_packages’*
    Installation path not writeable, unable to update packages: batchtools, bayestestR, beachmat, biomaRt, boot, brio, broom, caTools, circlize, class, cli,
  • cpp11, crayon, DelayedArray, DelayedMatrixStats, derfinder, derfinderHelper, DiffBind, DMRcate, DropletUtils, dynparam, edgeR, effectsize, enrichplot,*
  • FactoMineR, fastmap, findpython, forcats, foreign, formattable, furrr, future.apply, gdsfmt, gdtools, genefilter, gert, GetoptLong, GGally, ggridges,*
  • ggthemes, git2r, glmnet, gmp, GSEABase, HardyWeinberg, heatmaply, hexbin, htmltools, insight, IRdisplay, iSEE, knitr, leiden, lgr, liger, Matrix,*
  • MatrixGenerics, matrixStats, memoise, mice, nlme, nnet, parallelly, parameters, parsnip, patchwork, pathview, pbdZMQ, pbkrtest, pixmap, plotly, plotrix,*
  • pracma, preprocessCore, prettydoc, pROC, psycho, quantreg, rappdirs, RcppArmadillo, recount, renv, repr, reprex, rgdal, rgl, Rhdf5lib, riverplot,*
  • rmarkdown, robustbase, RSQLite, scran, sctransform, scuttle, Seurat, shiny, shinytest, shinythemes, shinyWidgets, spatstat.utils, speedglm, SQUAREM,*
  • systemfonts, systemPipeR, tibble, tinytex, VGAM, VIM, webdriver, withr, xgboost*
    Old packages: 'mco'

Could you please help me?

Thank you very much in advance!


ping @team.r


Please try:

mv $HOME/R $HOME/R_Old

And try again:

module load r/4.0.2



It worked, thank you very much!

Best wishes,