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

2

7

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??

Cedric answered 21/8, 2015 at 2:24 Comment(1)
This is a generic issue with any package when trying to download from an URL that is a redirect.Stile
C
7

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

Cedric answered 21/8, 2015 at 2:45 Comment(4)
That should still work. And if you do what I suggested in my answer above, you will no longer have to select a mirror as you will already have done so in the Rprofile.site file.Sagesagebrush
Moreover you should read up on https and why you should use it. You may need to set the download.file.method.Sagesagebrush
For me, specifying method="wget" works; but method="libcurl" (the default) doesn't, even though curl should support https.Komara
See capabilities()[["libcurl"]] which is likely false meaning an insufficient curl library was found when R was built. The issue is local to your machine or distro or versions -- whichever is responsible for the binary.Sagesagebrush
S
5

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.

Sagesagebrush answered 21/8, 2015 at 2:31 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.