Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to install.packages(): system call failed: Cannot allocate memory; installation of package had non-zero exit status

I'm using R version 3.1.2 (2014-10-31) -- "Pumpkin Helmet" on Platform: x86_64-pc-linux-gnu (64-bit).

I have an issue installing new packages in R, using RStudio. When I call the install.packages() function, I get:

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

The downloaded source packages are in
‘/tmp/Rtmpi0toFl/downloaded_packages’

I have installed R via shell commands and it worked ok. I've also decreased the swappiness value to 10, but I'm not sure if it has anything to do with the problem.

Thanks in advance!

like image 316
Juan Carlos López Tavera Avatar asked Nov 25 '14 20:11

Juan Carlos López Tavera


3 Answers

I figured out. I was all about the swap value.
There are several web pages that advice to decrease the default swap use in order to speed up Ubuntu. What I did to fix the problem.

In the terminal...

#Know the swap value    
cat /proc/sys/vm/swappiness
10
# Access the swap configuration
gksudo leafpad /etc/sysctl.conf

# Increase the swap usage to 30 (default is 60)
vm.swappiness=30

Then, I rebooted. And installed the packages happily without any problems.

like image 84
Juan Carlos López Tavera Avatar answered Oct 16 '22 11:10

Juan Carlos López Tavera


just restart the r-session. that did the trick for me.

like image 27
joaoal Avatar answered Oct 16 '22 09:10

joaoal


I confirm that the problem was with RAM space. i closed some background applications and it installed smoothly without any need to reboot my system

like image 42
Hamed Temsah Avatar answered Oct 16 '22 10:10

Hamed Temsah