1

I'm having difficulty installing R on Ubuntu 16.04. I realize similar questions have been posted before and I have tried all the solutions that were provided but none seem to work for me.

I'm following the instructions from this post.

I've never used Linux nor the Terminal prior to yesterday so in all honesty I don't really know what I'm doing and have just been trying the various commands that people have said might work, but unfortunately, to no avail.

This is the error message I get back:

The following packages have unmet dependencies: r-base : Depends: r-base-
core (>= 3.4.3-1xenial0) but it is not installable Depends: r-recommended 
(= 3.4.3-1xenial0) but it is not going to be installed Recommends: r-base-
html 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.

Any advice or guidance much apprecaited! Thanks for the help

Here are the outputs to what was asked for:

(xenial)samerbibi@localhost:~$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.3 LTS"
(xenial)samerbibi@localhost:~$ apt-cache policy r-base-core
r-base-core:
  Installed: (none)
  Candidate: (none)
  Version table:

(xenial)samerbibi@localhost:~$ sudo apt-get update
Get:1 http://cran.rstudio.com/bin/linux/ubuntu xenial/ InRelease [3590 B]
Get:2 https://cran.rstudio.com/bin/linux/ubuntu xenial/ InRelease [3590 B]
Hit:3 http://ppa.launchpad.net/marutter/rdev/ubuntu xenial InRelease           
Hit:4 http://ppa.launchpad.net/marutter/rrutter/ubuntu xenial InRelease      
Fetched 7180 B in 2s (3468 B/s)                                              
Reading package lists... Done
W: Target Packages (Packages) is configured multiple times in /etc/apt/sources.list:2 and /etc/apt/sources.list:5
W: Target Translations (en) is configured multiple times in /etc/apt/sources.list:2 and /etc/apt/sources.list:5
E: Failed to stat /var/lib/apt/lists/partial/cran.rstudio.com_bin_linux_ubuntu_xenial_InRelease - pkgAcqTransactionItem::TransactionState-stat (2: No such file or directory)
W: Target Packages (Packages) is configured multiple times in /etc/apt/sources.list:2 and /etc/apt/sources.list:5
W: Target Translations (en) is configured multiple times in /etc/apt/sources.list:2 and /etc/apt/sources.list:5
W: Duplicate sources.list entry https://cran.rstudio.com/bin/linux/ubuntu xenial/ Release

Okay I believe I managed to delete the duplicate so should be no conflict between http and https. Got the following:

(xenial)samerbibi@localhost:~$ sudo apt-get update
Hit:1 https://cran.rstudio.com/bin/linux/ubuntu xenial/ InRelease
Hit:2 http://ppa.launchpad.net/marutter/rdev/ubuntu xenial InRelease
Hit:3 http://ppa.launchpad.net/marutter/rrutter/ubuntu xenial InRelease      
Reading package lists... Done                      
(xenial)samerbibi@localhost:~$ 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.4.3-1xenial0) but it is not installable
          Depends: r-recommended (= 3.4.3-1xenial0) but it is not going to be installed
          Recommends: r-base-html 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.
  • Not sure I can help - but please [edit] your question to include the output of cat /etc/lsb-release and apt-cache policy r-base-core – steeldriver Jan 13 '18 at 14:03
  • Hi @steeldriver, i just edited the question to include the outputs to what you asked for. No worries if it helps or not, I appreciate you taking the time either way! – Samer Bibi Jan 14 '18 at 17:35
  • Hmm - it's odd that it's not finding ANY version of that package (either from the CRAN repository that I assume you added, or from the regular Ubuntu repo). Were there errors when you executed sudo apt-get update? If so, please add them – steeldriver Jan 14 '18 at 17:44
  • i think there's definitely something funky going on – Samer Bibi Jan 14 '18 at 17:50
  • I think the issue may be that you have the cran repository listed in /etc/apt/sources.list twice - with different protocols (http versus https). Please check and remove ONE of the entries. – steeldriver Jan 14 '18 at 18:15
  • okay i think i deleted it such that there shouldn't be a conflict but still unable to install. Pasted the output in the question – Samer Bibi Jan 14 '18 at 18:30

0 Answers0