【问题标题】:CRAN/ Bioconductor package installs fail: Error: Line starting '<!DOCTYPE HTML PUBLI ...' is malformedCRAN/Bioconductor 包安装失败:错误:行开始 '<!DOCTYPE HTML PUBLI ...' 格式错误
【发布时间】:2015-11-14 20:58:21
【问题描述】:

我刚刚进行了全新的 Ubuntu 14.04 安装,并按照 this linkthis other one 的说明安装了 R,像往常一样选择伯克利镜像。

在 emacs (+ess) 上,我根本无法安装任何 CRAN 或 Bioconductor 软件包,例如:

install.packages("ggplot2")

或者:

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

我经常收到以下错误:

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

this other thread 之后,我只是等着看问题是否自行解决,但 2 天后我一直收到同样的错误。有什么建议吗??

【问题讨论】:

  • 当尝试从重定向的 URL 下载时,这是任何包的普遍问题。

标签: r redirect installation package cran


【解决方案1】:

请显示什么

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

包含。对于它的价值,我以这种方式设置了 CRAN 以及另外两个 drat 并且从来没有问题:

## 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)
})

您可以通过这种方式设置 CRAN、BioC 和任何其他数量的存储库。

【讨论】:

    【解决方案2】:

    好吧,我已经解决了问题,结果提示选择 CRAN 镜像时,我正在选择

    USA (CA1) [https]
    

    代替

    (HTTP mirrors)
    

    这是我从未见过的功能......

    选择 HTTP 镜像会将我带到我期待的镜像列表中,现在选择

    USA (CA1)
    

    使安装过程完美运行。谢谢!

    【讨论】:

    • 这应该仍然有效。如果您按照我在上面回答中的建议进行操作,您将不再需要选择镜像,因为您已经在 Rprofile.site 文件中这样做了。
    • 此外,您应该read up on https and why you should use it。您可能需要设置download.file.method
    • 对我来说,指定method="wget" 有效;但method="libcurl"(默认)不支持,即使 curl 应该支持 https。
    • 请参阅capabilities()[["libcurl"]],这可能是错误的,表示构建 R 时发现的 curl 库不足。该问题是您的机器或发行版或版本的本地问题 - 以负责二进制文件的为准。
    【解决方案3】:

    由于这在 Google 中出现的频率很高,我想分享一下您的 R 版本可能是问题所在。

    【讨论】:

      猜你喜欢
      • 2012-06-05
      • 2020-08-16
      • 1970-01-01
      • 1970-01-01
      • 2012-01-08
      • 2014-06-01
      • 2021-07-30
      • 1970-01-01
      相关资源
      最近更新 更多