【问题标题】:Unable to update/install packages in R 3.2.2 running on Google Compute Engine (Debian Wheezy )无法更新/安装在 Google Compute Engine (Debian Wheezy) 上运行的 R 3.2.2 中的软件包
【发布时间】:2015-08-26 20:18:41
【问题描述】:

我在 Debian wheezy 上运行的 Google Compute Engine 上创建了一个基本实例。我的目标是在实例上安装 R 并通过 Jupyter/Ipython notebook 远程访问它。

我面临的问题是,一旦我安装了 R 3.2.2。 “消防安全” 并且我尝试使用 update.packages() 更新软件包,但我无法这样做,并且收到警告说明:unable to access index for repository https://cran.<rest of mirror address> 这与我选择的 CRAN 镜像无关(18 个镜像选项) .同样,如果我尝试使用 install.packages('jsonlite') 安装 jsonlite 等基本软件包,我会收到类似的错误:

Warning: unable to access index for repository https://cran.cnr.Berkeley.edu/src/contrib Warning message: package ‘jsonlite’ is not available (for R version 3.2.2)。同样,这个错误与我选择的镜像无关。

如果它对诊断有任何帮助,我在创建新实例后安装 R 的方式如下:

sudo apt-get update
sudo apt-get upgrade
sudo -i
echo "deb http://cran.r-project.org/bin/linux/debian wheezy-cran3/" > /etc/apt/sources.list.d/cran.list
apt-get update
apt-get upgrade
apt-get install r-base-core r-base-dev

谁能提出可能导致此更新/安装包问题的原因?

【问题讨论】:

    标签: r debian google-compute-engine


    【解决方案1】:

    两个快速的想法:

    1. https 替换为http,例如在install.packages("digest", repos="http://cran.cnr.berkeley.edu")

    2. 将仓库切换到我们知道支持 https 的仓库,例如install.packages("digest", repos="https://cran.rstudio.com")

    我可以通过 http 和 https 使用 Berkeley 主机,但也许 AWS 会阻止端口 443?

    【讨论】:

      【解决方案2】:

      通过an answer on Unix.SE

      您需要安装包apt-transport-https。然后你可以使用像

      这样的行
      deb https://some.server.com/debian stable main
      

      在您的 sources.list 文件中。

      【讨论】:

        猜你喜欢
        • 2015-12-09
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2014-07-24
        • 1970-01-01
        • 2015-10-04
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多