2016-12-03 83 views
3

我在安裝「eurostats」軟件包時遇到問題。解決問題後,我推斷問題在於「readr」軟件包。試圖安裝,出現這種情況:R(Ubuntu) - 無法安裝軟件包「readr」和「eurostat」

* installing *source* package ‘readr’ ... 
** libs 
g++ -I/usr/share/R/include -DNDEBUG -I"/home/shiny/R/x86_64-pc-linux-gnu-library/3.3/Rcpp/include" -I"/home/shiny/R/x86_64-pc-linux-gnu-library/3.3/BH/include" -fpic -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g -c Collector.cpp -o Collector.o 

之後,終端只是凍結,就好像它是積極的,但沒有happens.Prior到這一點,我有種與區域設置解決(只提它,如果它幫助)。我能夠安裝其他軟件包。

我的R和Linux的詳情如下:

sessionInfo() 
R version 3.3.2 (2016-10-31) 
Platform: x86_64-pc-linux-gnu (64-bit) 
Running under: Ubuntu 16.04.1 LTS 

locale: 
[1] LC_CTYPE=en_US.UTF-8  LC_NUMERIC=C    
[3] LC_TIME=en_US.UTF-8  LC_COLLATE=en_US.UTF-8  
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 
[7] LC_PAPER=en_US.UTF-8  LC_NAME=C     
[9] LC_ADDRESS=C    LC_TELEPHONE=C    
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C  

attached base packages: 
[1] stats  graphics grDevices utils  datasets methods base  

loaded via a namespace (and not attached): 
[1] httr_1.2.1  R6_2.2.0  tools_3.3.2  withr_1.0.2  
[5] curl_2.2  memoise_1.0.0 git2r_0.16.0 digest_0.6.10 
[9] devtools_1.12.0 

有人能幫助我嗎?

+0

多久你凍結後等待?終端工作(cpu/memory uasge)?你的軟件包是否是最新版本('old.packages(checkBuilt = TRUE)', 尤其是Rcpp和BH)? – Marek

+0

我等了大約一個小時。終端是和正在工作。這些軟件包是最新的。 – ilitse

+1

我剛剛發現https://github.com/tidyverse/readr/issues/544報告了類似的問題(如果不是相同的話)。這是這種情況還是別的? – ilitse

回答

9

該機器上的內存不足。所以,你有兩個選擇:

  • 繼續自己在做什麼,並試圖從源代碼,這將需要更多的內存,並有可能編譯失敗

  • 安裝預編譯的二進制(!),這樣你沒有在第一時間

最簡單的方法是這樣的編譯了(我只顯示命令,而不是輸出,而我這樣做在Ubuntu 16.04的泊塢窗實例,我我在Docker中這樣做的帳戶是root;否則在前面加sudo

apt-get update  # refresh 
apt-get install software-properties-common 
add-apt-repository -y "ppa:marutter/rrutter" 
add-apt-repository -y "ppa:marutter/c2d4u" 
apt-get update  # now with new repos 
apt-get install r-cran-readr 

你有readr包。現在繼續進行eurostat,它不是打包成二進制文件,但可能不需要讀取器由於其C++代碼而執行的較重資源。

+0

是的,這對我很好!感謝您的解決方案@DirkEddelbuettel – ilitse

1

我的覆盆子pi有同樣的問題。解決方法是增加交換的大小(在我的情況下爲1Gb)。這裏是步驟:

sudo swapon -s #get size and filename 
sudo swapoff -a #stop the actual swaps 
sudo fallocate -l 1g swap2 #allocate 1Gb for the swapfile 
sudo mkswap swap2 
sudo swapon swap2 

啓動R並安裝您的軟件包。

如果你需要找回以前的配置:

sudo swapoff -a 
sudo rm swap2 
sudo swapon your-previous-swap