簡體   English   中英

在 Ubuntu 18.04 中重新安裝 R 時遇到困難

[英]Having difficulty with re-installing R in Ubuntu 18.04

最近我從 Windows 轉移到 Ubuntu 並下載了 R-base (3.4.4) 和 R 工作室。 但是,某些軟件包(汽車、ROCR 等)不可用,因此我嘗試更新 R。 因為報錯信息,最后嘗試卸載刪除R,然后重新安裝。

我試過了

sudo apt-get upgrade
sudo apt install r-base

但是,它向我顯示錯誤消息,例如,

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.6.2.20200221-1~ubuntu18.04.1~ppa1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

所以基本上現在,我沒有安裝 R-base。

我試圖刪除 R-base。

sudo apt-get remove r-base

而我得到的只是——

    Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package 'r-base' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

我是 R 和 Linux 的初學者。 我需要你的寶貴建議。 提前致謝。

如果您使用的是 Ubuntu 18.04,如果您使用自己的本地機器,請按照以下步驟操作。 (如果您在任何辦公環境中工作,請設置代理並按照以下步驟操作)

1)我們先添加相關的GPG密鑰

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9

2) 添加 R 存儲庫

sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/'

3) 更新 Package 列表

sudo apt update

4)安裝R

sudo apt install r-base

5) 測試安裝

sudo -i R

6) 從 CRAN 安裝 R 包

install.packages('dplyr')

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM