user3488736 user3488736 - 24 days ago 133
Linux Question

How to install R on ubuntu 16.10 via the terminal?

I'm trying to install R from the terminal following this site:
https://www.r-bloggers.com/how-to-install-r-on-linux-ubuntu-16-04-xenial-xerus/

When I execute

sudo apt-get install r-base
, I get the following error:

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.3.2-1xenial0) but it is not going to be installed
Depends: r-recommended (= 3.3.2-1xenial0) 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.


Can someone please help me out?

Many thanks in advance

Answer

Add the two others to the command, and see the errors it generates, ie do

sudo apt-get install r-base r-base-core r-recommended

You likely you have something installed which conflicts. Many (and I mean thousands) of us run these packages just fine.

You can also consider the r-sig-debian mailing list.