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

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


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.