在从源代码安装R之前,我通常会执行“sudo apt-get build-dep r-base”,这在Ubuntu下一直有效。现在我有一个带有LXDE的Debian(测试)机器,当执行上述命令时,我会得到“E:无法找到r-base的源软件包”的错误。可能是什么原因导致了这个错误?
更新
我忘记将“deb http://stat.ethz.ch/CRAN/bin/linux/debian jessie-cran3”和“deb-src http://stat.ethz.ch/CRAN/bin/linux/debian jessie-cran3”添加到“/etc/apt/sources.list”中。在执行“sudo apt-get update”后,我获得了以下结果:
更新
我忘记将“deb http://stat.ethz.ch/CRAN/bin/linux/debian jessie-cran3”和“deb-src http://stat.ethz.ch/CRAN/bin/linux/debian jessie-cran3”添加到“/etc/apt/sources.list”中。在执行“sudo apt-get update”后,我获得了以下结果:
Reading package lists... Done
W: GPG error: http://stat.ethz.ch jessie-cran3/ Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 06F90DE5381BA480
根据cran.r-project.org的指南,在下载Linux版本的R时,需要添加密钥。由于添加密钥失败,我通过以下方式进行了微调:sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key <NUMBER>
其中<NUMBER>
是上面提供的数字,因此是06F90DE5381BA480。
options(repos=c(CRAN="http://cran.ch.r-project.org"))
。也许那就是服务器的来源。干杯,M。 - Marius Hofert