I'm having this problem while trying to install any package in my Raspberry Pi.
Some general info about the system and software:
Raspberry Pi 3
Raspbian Jessie with Pixel (Novermber 2016, latest version)
R 3.1.1
When I try install.packages("XML"), it asks me to choose a mirror, then after I choose and it download, the result is:
The dowloaded source packages are in
'/tmp/RtmpBOxeKj/downloaded_packages'
Warning messages:
1: In system2(cmd0, args, env = env, stdout = outfile, stderr = outfile) : system call failed: Cannot allocate memory
2: In install.packages("XML") : installation of package 'XML' had non-zero exit status
This happens with any package I try to install (sometimes only the second error and sometimes both).
After booting Raspbian I have 610MB of free RAM and after opening the R console I have 582MB of free RAM, then goes down to 282MB when I try installing the package. Shouldn't that be enough?
Any idea?