Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CRAN/ Bioconductor package installs fail: Error: Line starting '<!DOCTYPE HTML PUBLI ...' is malformed

I have just made a fresh Ubuntu 14.04 installation and installed R following the instructions at this link and this other one, selecting the Berkeley mirror as I always do.

On emacs (+ess), I am unable to install any CRAN or Bioconductor package at all, for example:

install.packages("ggplot2")

Or:

source("http://bioconductor.org/biocLite.R")
biocLite("biomaRt")

I constantly get the following error:

Error: Line starting '<!DOCTYPE HTML PUBLI ...' is malformed!

Following on this other thread, I have just waited to see if the problem solved by itself, but after 2 days I keep getting the same error. Any suggestion??

like image 522
DaniCee Avatar asked Aug 21 '15 02:08

DaniCee


2 Answers

Alright I already solved the problem, turns out when prompting to select a CRAN mirror, I was selecting

USA (CA1) [https]

Instead of

(HTTP mirrors)

This is a feature I had never seen...

enter image description here

Selecting HTTP mirrors brings me to the list of mirrors I was expecting, and selecting now

USA (CA1)

Makes the installation process work perfectly. Thanks!

enter image description here

like image 167
DaniCee Avatar answered Nov 04 '22 21:11

DaniCee


Please show what

Rscript -e 'print(options("repos"))' 

contains. For what it is worth, I set CRAN as well as two more drat this way and never have an issue:

## Example of Rprofile.site snippet
local({
    r <- getOption("repos")
    r["CRAN"] <- "http://cran.rstudio.com"
    r["eddelbuettel"] <- "http://eddelbuettel.github.io/drat"
    r["ghrr"] <- "http://ghrr.github.io/drat"
    options(repos = r)
})

You can set CRAN, BioC and any other number of repositories this way.

like image 23
Dirk Eddelbuettel Avatar answered Nov 04 '22 21:11

Dirk Eddelbuettel