0

I am trying to install R studio packages. I am running R as a "datacleaning" user this user

Some packages are installed from the local sources:

if (!require("SparseM", lib=lib.path)) install.packages("/dc/R/p1/SparseM_1.7.gz", repos = NULL, type="source", lib=lib.path)

The others directly from R cran

if (!require("stringr", lib=lib.path)) install.packages("stringr", lib=lib.path, repos=url.cran)

This is what the installation packages directory looks like:

    drwxrwxr-x  7 root         root  4096 feb  8 15:15 base64enc
    drwxrwxr-x  8 datacleaning users 4096 feb  8 15:11 bit
    drwxrwxr-x  9 root         root  4096 feb  8 15:19 bit64
    drwxrwxr-x  9 root         root  4096 feb  8 15:16 data.table
    drwxrwxr-x  6 root         root  4096 feb  8 15:15 evaluate
    drwxrwxr-x  9 root         root  4096 feb  8 15:15 foreign
    drwxrwxr-x 11 root         root  4096 feb  8 15:16 gdata
    drwxrwxr-x  8 root         root  4096 feb  8 15:16 gtools
    drwxrwxr-x  7 root         root  4096 feb  8 15:15 highr
    drwxrwxr-x 14 datacleaning users 4096 feb  8 15:15 knitr
    drwxrwxr-x  7 root         root  4096 feb  8 15:15 magrittr
    drwxrwxr-x 11 root         root  4096 feb  8 15:15 markdown
    drwxrwxr-x  7 datacleaning users 4096 feb  8 15:11 mime
    drwxrwxr-x  8 datacleaning users 4096 feb  8 15:16 plyr
    drwxrwxr-x 16 datacleaning users 4096 feb  8 15:16 Rcpp
    drwxrwxr-x  8 datacleaning users 4096 feb  8 15:16 reshape2
    drwxrwxr-x  6 datacleaning users 4096 feb  8 15:15 sendmailR
    drwxrwxr-x  8 datacleaning users 4096 feb  8 15:15 stringi
    drwxrwxr-x  9 root         root  4096 feb  8 15:15 stringr
    drwxrwxr-x  8 datacleaning users 4096 feb  8 15:11 xtable
    drwxrwxr-x  7 root         root  4096 feb  8 15:15 yaml

Why is the installed package ownership becoming root? Some packages dependencies are trying to access those root packages. But then I am lacking of permission to access the root package.

Maybe I am missing something about R package installation

camilleb
  • 1
  • 1
  • Not sure how you got it like this, but you can fix the ownership with `sudo chown -R your_username:your_group folder` (assuming you have a password to get root privileges) – dww Feb 08 '18 at 15:00
  • 2
    Can you post a minimal example and the errors you are getting? All directories are world readable, so even the `datacleansing` user should be able to access them. – Ralf Stubner Feb 08 '18 at 15:06
  • What are the permissions of the `/dc/R/p1/SparseM_1.7.gz` files? What `url.cran` are you using? – MrFlick Feb 08 '18 at 16:36
  • Thanks @dww for the suggestion, however I would like to automate the process and not have to fix the ownership afterwards. This would be the kind of error: `Loading required package: bit64 Failed with error: ‘package ‘bit’ required by ‘bit64’ could not be found’`. The permissions are: ` drwxrwxr-x 9 datacleaning users 4096 feb 8 15:41 bit64 -rw-r--r-- 1 root root 28131 feb 8 16:41 car ` – camilleb Feb 13 '18 at 13:06

0 Answers0