安裝舊版的軟體和依賴項

安裝舊版的軟體和依賴項

我需要安裝R3.0.2,因為所需的函式庫與 3.0.3(最新)還不相容。

我可以像這樣安裝舊版的 R:

sudo apt-get install r-base=3.0.2-1precise0

然而,r-base 的所有相依性都嘗試使用 3.0.3 安裝

root@foo:~# apt-get install r-base=3.0.2-1precise0
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 r-base : Depends: r-recommended (= 3.0.2-1precise0) but 3.0.3-1precise0 is to be installed
E: Unable to correct problems, you have held broken packages.

如何安裝 r-base 3.0.2 和所有依賴項作為 3.0.2 ?

答案1

  • 首先移除軟體包

    sudo apt-get remove r-base
    
  • 一點清潔

    sudo apt-get clean; sudo apt-get autoclean
    
  • 重新安裝強制使用舊版本

    sudo apt-get install r-base=3.0.2-1precise0
    

答案2

您可以透過簡單地安裝在頂部來降級軟體包。 apt 夠聰明,可以正確處理這個問題。

為了安裝 R 3.0.2,我運行 dpkg -S /usr/bin/R 並發現二進位檔案是由r-base-core.降級解決了問題

apt-get install r-base-core=3.0.2-1precise0  
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  r-cran-foreign ...
Use 'apt-get autoremove' to remove them.
Suggested packages:
  ess r-doc-info r-doc-pdf r-mathlib
The following packages will be REMOVED:
  r-base r-cran-class r-cran-cluster r-cran-kernsmooth r-cran-mass r-cran-matrix r-cran-mgcv r-cran-nlme r-recommended
The following packages will be DOWNGRADED:
  r-base-core
0 upgraded, 0 newly installed, 1 downgraded, 9 to remove and 123 not upgraded.
Need to get 21.5 MB of archives.


apt-get install r-base=3.0.2-1precise0
...
apt-get install r-recommended=3.0.2-1precise0
...

答案3

從軟體和更新中停用「Universe」儲存庫,然後在終端機上執行以下命令,

sudo add-apt-repository ppa:marutter/rdev
sudo apt-get update 
sudo apt-get install r-base

相關內容