Hello!
I'm trying to get a web app running on an amazon ubuntu server. I need to install the raster package, but R seems to freeze whenever I try at this point:
$ sudo su - -c "R -e "install.packages('raster')""
R version 3.4.4 (2018-03-15) -- "Someone to Lean On"
Copyright (C) 2018 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
Natural language support but running in an English locale
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
install.packages('raster', repos='https://cran.rstudio.com/')
Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/src/contrib/raster_2.9-5.tar.gz'
Content type 'application/x-gzip' length 971151 bytes (948 KB)
==================================================
downloaded 948 KB
You are not showing any error message, if your ec2 instance has limited resources, then maybe you just have to wait for the library to compile. Have you checked with htop on a separate terminal if your cores are busy while installing? Is your ram memory completely allocated during installation?
this is what happens in the end, after waiting for hours:
g++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-5/README.Bugs> for instructions.
/usr/lib/R/etc/Makeconf:168: recipe for target 'RasterModule.o' failed
make: *** [RasterModule.o] Error 4
ERROR: compilation failed for package ‘raster’
removing ‘/usr/local/lib/R/site-library/raster’
The downloaded source packages are in
‘/tmp/Rtmp1vN6Jt/downloaded_packages’
Have you checked your allocated RAM memory during installation? this could be happening because of you running out of memory, how much memory do you have in your ec2 instance?
You could try to add some more SWAP memory and see if this helps.
Consider temporarily using a bigger AWS instance. Micro (the free one) does not have enough memory to compile {raster} . It can run it, but for installation you need a small or medium instance. AWS bills per second, and you will need just a couple minutes.
Yes, this worked like a charm! Thanks for sharing the tweet as well, I didn't bump into this problem when I installed the raster package a couple of months ago!
Fieldwork is saved Thanks a lot!