2015-10-07 193 views
7

我使用apt get來安裝它,現在它說3.2.2 - 這是一個違規的版本。我如何降級到3.1.1?如何在Ubuntu上將R版本3.2.2降級到版本3.1.1

更新:

install.packages(c("batch", "bitops", "boot", "caTools", "data.table", "doMC", "doSNOW", "ggplot2", "glmnet", "lda", "Matrix", "matrixStats", "moments", "plotrix", "psych", "reshape", "topicmodels", "wordcloud", "methods"), dependencies=TRUE) 

Warning messages: 
1: package ‘methods’ is not available (for R version 3.2.2) 
2: In install.packages(c("boot", "caTools", "data.table", "doMC", "doSNOW", : 
    installation of package ‘RCurl’ had non-zero exit status 
3: In install.packages(c("boot", "caTools", "data.table", "doMC", "doSNOW", : 
    installation of package ‘curl’ had non-zero exit status 
4: In install.packages(c("boot", "caTools", "data.table", "doMC", "doSNOW", : 
    installation of package ‘XML’ had non-zero exit status 
5: In install.packages(c("boot", "caTools", "data.table", "doMC", "doSNOW", : 
    installation of package ‘OAIHarvester’ had non-zero exit status 
6: In install.packages(c("boot", "caTools", "data.table", "doMC", "doSNOW", : 
    installation of package ‘topicmodels’ had non-zero exit status 

如何降級?

+0

http://askubuntu.com/questions/435232/install-older-version-of-software-and-dependencies – RHertel

+0

「已知問題:package'methods'不適用於R 3.2.1版,在這種情況下,請將R降級到版本3.1.1」 - 我現在從頭開始全新安裝R。 – user5331677

+0

但'方法'是一個默認包,隨R安裝而來。 – 2015-10-07 06:14:54

回答

12

所以我最近遇到了同樣的問題。 這裏有一個解決方案:

  1. 刪除當前安裝的 - [R版本,

    sudo apt-get remove r-base-core 
    sudo apt-get autoremove 
    
  2. 查找你需要的版本,

    apt-cache showpkg r-base 
    

它看起來像以下:

Package: r-base 
Versions: 
3.2.2-1precise0  (/var/lib/apt/lists/cran.rstudio.com_bin_linux_ubuntu_precise_Packages) 
Description Language: 
      File:  /var/lib/apt/lists/cran.rstudio.com_bin_linux_ubuntu_precise_Packages 
       MD5: 5787ca79ed716232c4cc2087ed9b425b 

之後,查找所需版本並安裝它。 但是,在R基本將再次拋出錯誤,安裝所以才執行:

sudo apt-get install r-base-core=3.1.1-1precise0 
+0

您應該指定''精確'指的是Ubuntu安裝。例如,對我來說,這是'可靠的'。 – MERose

+0

關於@MERose評論的更多信息:[Ubuntu發佈列表](http://releases.ubuntu.com/)... Ubuntu 14.04是'trusty'等。 –