安装 R Ubuntu 17.10

安装 R Ubuntu 17.10

我正在尝试在 ubuntu 17.10 上安装 R

我有以下输出;

$ sudo apt install r-base-core
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-core : Depends: libpng12-0 (>= 1.2.13-4) but it is not installable
               Recommends: r-recommended but it is not going to be installed
               Recommends: r-base-dev but it is not going to be installed
               Recommends: r-doc-html but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

我尝试了以下方法:

$sudo dpkg --get-selections | grep deinstall

无输出。

$sudo apt-get install -f
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

$sudo aptitude full-upgrade
No packages will be installed, upgraded, or removed.
0 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B of archives. After unpacking 0 B will be used.

所以现在我不知道该如何继续前进......

答案1

我添加了错误的代表:

sudo add-apt-repository 'deb [arch=amd64,i386] https://cran.rstudio.com/bin/linux/ubuntu xenial/' 

应该

sudo add-apt-repository 'deb [arch=amd64,i386] https://cran.rstudio.com/bin/linux/ubuntu artful/'

答案2

您应该首先通过运行以下命令删除错误的“xenial”存储库:

sudo add-apt-repository -r 'deb [arch=amd64,i386] https://cran.rstudio.com/bin/linux/ubuntu xenial/'

然后r-base-core运行安装:

sudo apt install r-base-core

相关内容