1

I am running a software called CNV-Seq in a Bash script but, I do not have permission to run the following command:

R CMD INSTALL cnv/

The error is

* installing to library '/share/apps/r/3.2.2/intel/lib64/R/library'
Error: ERROR: no permission to install to directory '/share/apps/r/3.2.2/intel/lib64/R/library'

How can I solve this problem without gaining permission.

kgui
  • 4,015
  • 5
  • 41
  • 53
  • You can install to home based directories that you have access to. How to do this depends on whether you are compiling from source, or the package manager you are using. You can also check sudoers and see if any commands run as root - you never know there may be a backdoor. Some commercial software installations for example have tar in sudoers, which allows unlimited root access to the system. – Owl Nov 13 '15 at 16:29
  • What is the output of `.libPaths()`? –  Nov 13 '15 at 16:54

1 Answers1

1

One approach is creating the bash script that executes R script. So, the R script will contain:

install.packages("package_name")

Save it as xyz.r

and the bash script will contain:

R -f path_to/xyz.r

Save that as abc.

Run the bash script like this:

bash abc
user3071284
  • 6,955
  • 6
  • 43
  • 57
timekeeper
  • 698
  • 15
  • 37
  • 1
    Please use the comments for such question. –  Nov 13 '15 at 16:26
  • 1
    I would have commented if and only if I had 50 reps. I cant comment on questions and answers by other people. Sorry for the inconvenience. – timekeeper Nov 13 '15 at 16:35
  • It will probably fail if you don't specify a local folder. As it, it will certainly try to install package in `'/share/apps/r/3.2.2/intel/lib64/R/library'`. –  Nov 13 '15 at 16:55