install.packages R on Ubuntu 12.04 downloads but does not install packages

廉价感情. 提交于 2019-11-27 16:02:32
Erik Westlund

@jdharrison helped out. The problem was insufficient memory on the VPS I was running, so I added some swap as described here:

How do you add swap to an EC2 instance?

Look at the last lines:

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

You have to go to the directory /tmp/RtmpoPUAFL/downloaded_packages (cd ...) and then install them manualy in the order that is pointed out above. So

R CMD INSTALL colorspace_1.2-4.tar.gz
R CMD INSTALL stringr_0.6.2.tar.gz
R CMD INSTALL ggplot2_0.9.3.1.tar.gz

Then trylibrary(ggplot2) now it should work

I have no idea why you have to do this sometimes... I anyone knows i am happy to learn it as well.

If your server does not have enough ram, R can not install packages.

The solution is to either increase the physical ram, or increase the size of the swap file.

Create a 2 gig swap file

sudo fallocate -l 2G /swap.img
sudo mkswap /swap.img
sudo swapon /swap.img

You can see how much free swap is available with the swapon command

root@foo:# swapon -s
Filename                Type        Size    Used    Priority
/swap.img                               file        2097148 213388  -1
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!