简体   繁体   中英

unable to install Rstudio packages in amazon EC2

I have installed amazon free trial linux t2.micro instance , and I installed RStudio , but when I try to install packages on RI get this error:

Warning in install.packages :
system call failed: Cannot allocate memory
Warning in install.packages :
installation of package 'igraph' had non-zero exit status

Even when I run a simple in R.

1+1

I get the same error:

system call failed: Cannot allocate memory

The problem is with the t2.micro instance. It has only 1GiB of Memory.

Choosing a larger instance would be the appropriate solution here. If you want to stick with the Free Tier eligible instance ( t2.micro ), one possible solution would be is to add some swap space .

Create a swap file for 1G (increase the value of count accordingly to increase the swap file size)

dd if=/dev/zero of=/swapfile bs=1M count=1024
mkswap /swapfile
swapon /swapfile

And, add this entry to /etc/fstab

/swapfile swap swap defaults 0 0

基于@franklinsijo的答案,我根据此链接中更详细的解决方案添加了交换空间https://www.cyberciti.biz/faq/linux-add-a-swap-file-howto/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM