最近,我从Windows转到Ubuntu,并下载了R-base(3.4.4)和R studio。但是,某些软件包(汽车,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的初学者。我需要您的宝贵建议。 预先感谢。
答案 0 :(得分:0)
如果您使用的是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)更新软件包列表
sudo apt update
4)安装R
sudo apt install r-base
5)测试安装
sudo -i R
6)从CRAN安装R软件包
install.packages('dplyr')