0
votes

I followed the instructions on randyzwitch's blog (http://randyzwitch.com/r-amazon-ec2/) to install r-studio server on ec2 instance running ubuntu 12.04.

When I start r-studio server and try to install packages, this is what was happening:

> install.packages("dplyr")
Warning in install.packages :
  package ‘dplyr’ is not available (for R version 2.14.1)
Installing package(s) into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
Warning in install.packages :
  'lib = "/usr/local/lib/R/site-library"' is not writable
Would you like to create a personal library
~/R/x86_64-pc-linux-gnu-library/2.14
to install packages into?  (y/n) y
Warning in install.packages :
  package ‘dplyr’ is not available (for R version 2.14.1)

I realized I need to update R so I checked out this post and updated it: https://askubuntu.com/questions/218708/installing-latest-version-of-r-base/436491#436491

I am logged in as sudo user. When I try to install package now, i get this:

> install.packages("plyr")
Installing package into ‘/home/ubuntu/R/x86_64-pc-linux-gnu-library/3.2’
(as ‘lib’ is unspecified)
also installing the dependency ‘Rcpp’

trying URL 'http://cran.rstudio.com/src/contrib/Rcpp_0.11.5.tar.gz'
Content type 'application/x-gzip' length 2353791 bytes (2.2 MB)
==================================================
downloaded 2.2 MB

trying URL 'http://cran.rstudio.com/src/contrib/plyr_1.8.2.tar.gz'
Content type 'application/x-gzip' length 392136 bytes (382 KB)
==================================================
downloaded 382 KB

Warning in install.packages :
  system call failed: Cannot allocate memory
Warning in install.packages :
  installation of package ‘Rcpp’ had non-zero exit status
Warning in install.packages :
  system call failed: Cannot allocate memory
Warning in install.packages :
  installation of package ‘plyr’ had non-zero exit status

The downloaded source packages are in
    ‘/tmp/Rtmp6Kgx5d/downloaded_packages’

I saw this post : lme4 package install failing on Ubuntu 12.04 and followed all instructions but it didn't solve the problem. Still same result. Thoroughly frustrated with trying to run rstudio server on aws. Someone please help!

2
ok, i've found my answer here: stackoverflow.com/questions/17173972/…vagabond

2 Answers

0
votes

Are you using the instance type t2.micro? Try using a more powerful instance with more RAM, that worked for me.

0
votes

Please make sure you are root user when installing packages:

  1. sudo su command will take you to root user. Then run your install package code.
  2. or use sudo before run you script: sudo Rscript 1.R