在Ubuntu 14.10上安装r-base时接收“Unmet依赖”

时间:2015-02-02 08:12:40

标签: r ubuntu ubuntu-14.10

我正在尝试在Ubuntu 14.10上安装R

当我发出命令下载r-base时,我收到以下错误

roy@laptop:~$ sudo apt-get 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-base-core (>= 3.1.2-1precise0) but it is not going to be installed
          Depends: r-recommended (= 3.1.2-1precise0) but it is not going to be installed
          Recommends: r-base-html but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

我该怎么办?我发现添加raring的后端可能有所帮助。我尝试了几台服务器,但我得到了404.

以下是我在/etc/apt/sources.list

中带来的以下更改
## R
deb http://cran.cnr.Berkeley.edu/bin/linux/ubuntu precise/



## Raring backports
deb http://us.archive.ubuntu.com/ubuntu/ raring-backports main restricted universe multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ raring-backports main restricted universe multiverse

1 个答案:

答案 0 :(得分:3)

第1步:

您可以在/etc/apt/sources.list文件中使用以下任何一项来获取R的最新副本,将<my.favorite.cran.mirror>替换为您喜欢的CRAN镜像的实际网址。有关CRAN镜像列表,请参阅http://cran.r-project.org/mirrors.html

deb http://<my.favorite.cran.mirror>/bin/linux/ubuntu utopic/
or
deb http://<my.favorite.cran.mirror>/bin/linux/ubuntu trusty/
or
deb http://<my.favorite.cran.mirror>/bin/linux/ubuntu precise/
or
deb http://<my.favorite.cran.mirror>/bin/linux/ubuntu lucid/

第2步:

要安装完整的R系统,请在命令行中使用以下命令:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E084DAB9
sudo add-apt-repository ppa:marutter/rdev
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install r-base

如需详细说明,请按照here链接中的步骤进行操作!