无法在亚马逊 EC2 中安装 Rstudio 包
unable to install Rstudio packages in amazon EC2
我安装了amazon免费试用linuxt2.micro实例,我安装了RStudio,但是当我尝试在 R 上 安装软件包 我收到此错误:
Warning in install.packages :
system call failed: Cannot allocate memory
Warning in install.packages :
installation of package ‘igraph’ had non-zero exit status
即使我 运行 一个简单的 R 语言。
1+1
我得到同样的错误:
system call failed: Cannot allocate memory
问题出在 t2.micro
实例上。它只有 1GiB
的内存。
在这里选择一个更大的实例是合适的解决方案。
如果您想坚持使用符合免费套餐条件的实例 (t2.micro
),一种可能的解决方案是添加一些 swap space.
为 1G
创建交换文件(相应地增加计数值以增加交换文件大小)
dd if=/dev/zero of=/swapfile bs=1M count=1024
mkswap /swapfile
swapon /swapfile
然后,将此条目添加到 /etc/fstab
/swapfile swap swap defaults 0 0
根据@franklinsijo的回答,我根据这个link https://www.cyberciti.biz/faq/linux-add-a-swap-file-howto/
中更详细的解决方案添加了一个swap space
我安装了amazon免费试用linuxt2.micro实例,我安装了RStudio,但是当我尝试在 R 上 安装软件包 我收到此错误:
Warning in install.packages :
system call failed: Cannot allocate memory
Warning in install.packages :
installation of package ‘igraph’ had non-zero exit status
即使我 运行 一个简单的 R 语言。
1+1
我得到同样的错误:
system call failed: Cannot allocate memory
问题出在 t2.micro
实例上。它只有 1GiB
的内存。
在这里选择一个更大的实例是合适的解决方案。
如果您想坚持使用符合免费套餐条件的实例 (t2.micro
),一种可能的解决方案是添加一些 swap space.
为 1G
创建交换文件(相应地增加计数值以增加交换文件大小)
dd if=/dev/zero of=/swapfile bs=1M count=1024
mkswap /swapfile
swapon /swapfile
然后,将此条目添加到 /etc/fstab
/swapfile swap swap defaults 0 0
根据@franklinsijo的回答,我根据这个link https://www.cyberciti.biz/faq/linux-add-a-swap-file-howto/
中更详细的解决方案添加了一个swap space