Sasa88
Sasa88

Reputation: 327

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 R I 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

Upvotes: 1

Views: 569

Answers (2)

Sasa88
Sasa88

Reputation: 327

Based on the answer of @franklinsijo, i added a swap space according to the more detailed solution in this link https://www.cyberciti.biz/faq/linux-add-a-swap-file-howto/

Upvotes: 0

franklinsijo
franklinsijo

Reputation: 18270

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

Upvotes: 3

Related Questions