简体   繁体   English

无法在亚马逊EC2中安装Rstudio包

[英]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: 我已经安装了amazon免费试用linux t2.micro实例 ,并且我安装了RStudio ,但是当我尝试在RI上安装软件包时出现此错误:

Warning in install.packages : install.packages中的警告:
system call failed: Cannot allocate memory 系统调用失败:无法分配内存
Warning in install.packages : install.packages中的警告:
installation of package 'igraph' had non-zero exit status 包'igraph'的安装具有非零退出状态

Even when I run a simple in R. 即使我在R中运行一个简单的

1+1 1 + 1

I get the same error: 我犯了同样的错误:

system call failed: Cannot allocate memory 系统调用失败:无法分配内存

The problem is with the t2.micro instance. 问题出在t2.micro实例上。 It has only 1GiB of Memory. 它只有1GiB的内存。

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 . 如果你想坚持使用Free Tier符合条件的实例( t2.micro ),一种可能的解决方案是添加一些交换空间

Create a swap file for 1G (increase the value of count accordingly to increase the swap file size) 1G创建交换文件(相应地增加计数值以增加交换文件大小)

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

And, add this entry to /etc/fstab 并且,将此条目添加到/etc/fstab

/swapfile swap swap defaults 0 0

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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