繁体   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