在 Ubuntu 18.04 中重新安装 R 时遇到困难 [英] Having difficulty with re-installing R in Ubuntu 18.04

查看:32
本文介绍了在 Ubuntu 18.04 中重新安装 R 时遇到困难的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近我从 Windows 转移到 Ubuntu 并下载了 R-base (3.4.4) 和 R studio.但是,有些软件包(汽车、ROCR 等)不可用,因此我尝试更新 R.由于错误消息,我最终尝试卸载并删除 R,然后重新安装.

Very recently I shifted to Ubuntu from Windows and downloaded R-base (3.4.4) and R studio. However, some packages (car, ROCR etc) were not available and hence I tried to update R. Because of error messages, I finally tried to uninstall and remove R and then install it again.

我试过了

sudo apt-get upgrade
sudo apt install r-base

但是,它向我显示错误消息,如

However, it is showing me error message like,

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.

So basically right now, I have no R-base installed.

我试图删除 R-base.

I tried to remove 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 的初学者.我需要你的宝贵建议.提前致谢.

I am a beginner in both R and Linux. I need your valuable suggestions. Thanks in advance.

推荐答案

如果您使用的是 Ubuntu 18.04,如果您使用的是自己的本地机器,请按照以下步骤操作.(如果您在任何办公环境中工作,请设置代理并按照以下步骤操作)

If you are using Ubuntu 18.04, please follow these steps if you are using your local machine of your own. (If your are working in any office environment please setup proxy and follow these steps)

1) 我们先添加相关的GPG密钥

1) Let’s first add the relevant GPG key

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

2) 添加 R 存储库

2) Add the R Repository

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

3) 更新包列表

sudo apt update

4) 安装 R

sudo apt install r-base

5) 测试安装

sudo -i R

6) 从 CRAN 安装 R 包

6) Installing R Packages from CRAN

install.packages('dplyr')

这篇关于在 Ubuntu 18.04 中重新安装 R 时遇到困难的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆