0

I'm looking to start working with R and RStudio on my ubuntu installation.

I am having problems with updating/installing my packages, sudh as DESeq2. According to this post it is because r-base installs packages into protected os files.

I have followed this posts recommendation but I have not had success. Others recommend chmodding the relative paths...

I am really surprised that the r-base install has this issue. I can't seem to find an updated installation method that avoids the issue. I wanted to ask if anyone had any further advice for overcoming this?

I am also using conda environments, but I have installed R and RStudio into the base environment to avoid problems, I don't think it supports being run through a conda environment.

I've been using ubuntu for a year and I don't want to have a janky R installation to cause headache.

would appreciate all insight.

Cheers.

Andy
  • 5
  • 1
  • Do you encounter the same error messages as in the post you linked? If not could you provide the exact error messages? – jkd Aug 09 '23 at 15:50
  • Hi, yes the exact same; have wiped the R installation completely using the steps described in the following post https://stackoverflow.com/questions/24118558/complete-remove-and-reinstall-r-including-all-packages – Andy Aug 09 '23 at 15:52
  • Could you provide the output of `Sys.getenv("R_LIBS_USER")` (from the R console)? – jkd Aug 09 '23 at 15:53
  • /root/R/x86_64-pc-linux-gnu-library/4.2 – Andy Aug 09 '23 at 15:56
  • 2
    Is it actually an issue for you? As you have recognized, some packages are installed system-wide and cannot be update using R's internal mechanisms (`update.packages()`) but they will get update (a little later) with the system packages (apt upgrade). – jkd Aug 09 '23 at 15:56
  • Ok so that's the issue. The path you provided is not writable for you as normal user. You could add 'R_LIBS_USER="~/.R/x86_64-pc-linux-gnu-library/"' to the ~/.Renviron in your home directory. Then restart R and try to update the packages. – jkd Aug 09 '23 at 16:08
  • Huh. I dug through my logs for a second and actually found that my problem lay elsewhere. Lesson learned to be more meticulous before posting. I thought it was interfering with the installation of DESeq2; but it was actually a missing xml2.config file. Glad to have it fixed. Thank you for your help on following up on this though, I really appreciate it. – Andy Aug 09 '23 at 16:14
  • If you use the Ubuntu binary mirrored at CRAN which follows the Debian binary, then `/usr/local/lib/R/site-library` is the defailt local installation. It is recommended to add yourself to group `adm` as the directory is group-witeable. Of course you can override with `~/R/...` Some folks, myself included, prefer `/usr/local`. Mix and match of distro and local is no issue per se -- but we can do a lot better now, See my answer for [r2u](eddelbuettel.github.io/r2u) as different binary approach covering all of CRAN. – Dirk Eddelbuettel Aug 09 '23 at 17:06

1 Answers1

0

You can combine Ubuntu 23.04 (which I am running on laptop and server) with r2u offering you 20,000 binary (!!) packages with full dependency resolution. It also has about 250 BioConductor packages inferred by these packages.

You can also try it in Docker. I just did via

docker run --rm -ti rocker/r2u         # launches r2u for 22.04

followed by (now inside the container)

Rscript -e 'system.time(install.packages("DESeq2"))'

and it installed 52 (binary) packages in in 15.8 seconds. Now we have DESeq2, and it is under the control of apt and will get updates as apt gets them. See the r2u site for more.

Dirk Eddelbuettel
  • 360,940
  • 56
  • 644
  • 725
  • 1
    This looks incredible man! Actually just going through setting up packages and its an awful pain installing dependencies manually! Will be sure to get it checked out! Thank you! – Andy Aug 09 '23 at 17:35