我是Linux的新手,请尝试在我的Raspberry上安装最新的R版本。我的树莓在Wheezy 7.8上运行。
我遵循on CRAN的指示,所以我
deb http://cran.rstudio.com/bin/linux/debian wheezy-cran3/
到/etc/apt/sources.list
apt-get update
成功,并且仅给我一个CRAN站点上指出的公钥“签名错误”apt-get install r-base
但是最后一条命令的结果是
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
r-base : Depends: r-base-core (>= 3.1.2-1~wheezycran3.0) but it is not going to be installed
Depends: r-recommended (= 3.1.2-1~wheezycran3.0) but it is not going to be installed
Recommends: r-base-html but it is not going to be installed
Recommends: r-doc-html but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
我之前尝试安装R-2.15,然后运行上述命令。 R-2.15可以成功安装,但是我真的需要R-3 *。
我确实浏览了网络,但是找不到针对我的特定问题的有用提示,因此,我感谢您能为我提供的任何支持。
谢谢!
如果有任何用途:apt-cache policy r-base
给出
r-base:
Installed: (none)
Candidate: 3.1.2-1~wheezycran3.0
Version table:
3.1.2-1~wheezycran3.0 0
500 http://cran.rstudio.com/bin/linux/debian/ wheezy-cran3/ Packages
3.1.0-1~wheezycran3.0 0
500 http://cran.rstudio.com/bin/linux/debian/ wheezy-cran3/ Packages
2.15.1-4 0
500 http://mirrordirector.raspbian.org/raspbian/ wheezy/main armhf Packages
apt-cache policy r-base-core
给出
r-base-core:
Installed: (none)
Candidate: 2.15.1-4
Version table:
2.15.1-4 0
500 http://mirrordirector.raspbian.org/raspbian/ wheezy/main armhf Packages
uname -a
给出
Linux raspberrypi 3.18.5+ #744 PREEMPT Fri Jan 30 18:19:07 GMT 2015 armv6l GNU/Linux
我有相同的情况,并决定从源代码安装它,而不是从存储库中安装R(apt-get命令)。
这是我在Raspberry Pi 2上运行的命令。我可以成功安装并运行R(3.1.2)。对于您来说,这可能不是一个完整的答案,因为我可能已经像gcc一样安装了您以前没有的库。如果您遇到其他问题,请告诉我。我想解决它。
[仅作为本主题的补充说明,因为sudo make install
过程花费了很长时间(可能超过一个小时。我不确定是因为我在知道之前就睡着了...),因此建议您这样做当你有足够的时间或像我这样睡觉之前。
wget http://cran.rstudio.com/src/base/R-3/R-3.1.2.tar.gz
mkdir R_HOME
mv R-3.1.2.tar.gz R_HOME/
cd R_HOME/
tar zxvf R-3.1.2.tar.gz
cd R-3.1.2/
sudo apt-get install gfortran libreadline6-dev libx11-dev libxt-dev
./configure
make
sudo make install
R
导致问题的原因很可能是cran存储库提供了软件包的armel
版本,而不是armhf
(这是RPI的预期体系结构)。如果这是正确的,那么您有两个解决方案:
armel
版本,然后在体系结构不匹配的情况下强制安装它们。尽管您可能会遇到性能问题,但它应该按照Debian wiki起作用:Raspberry Pi中的CPU实现了ARMv6 ISA(带有VFP2),并且因此与ARMv7 + VFP3的Debian armhf端口基准不兼容和用于其他发行版的ARM硬件浮点端口,所有基准都相同。与Debian armel兼容(armv4t,软(模拟)FP),但浮点任务将很慢运行Debian armel端口时。
为此,您可以尝试通过指定armel
体系结构来重新安装软件包,例如:
apt-get install r-base:armel
如果无法通过这种方式工作,则可以从http://cran.r-project.org/bin/linux/debian/wheezy-cran3/下载软件包,并使用类似以下的命令行手动安装它们:
dpkg --install --force-architecture xxxx_armel.deb yyyy_armel.deb zzzz_armel.deb
我通过升级 Wheezy to Jessie解决了我的第一个问题。我不是专家,但是Jessie似乎是Debian的当前测试版本,而Wheezy是稳定版本-请参见here。对于升级,我遵循了here或here或here的说明。注意:升级需要相当长的时间,在此过程中,您需要回答一些问题。
不过要小心:Jessie仍在[[testing”,有些人建议不要使用它,有关讨论请参见例如here。我确实从一个全新的全新映像完全设置了它,并且效果很好。
升级到Jessie后,我安装了R-3.1.1。使用sudo apt-get install r-base
并且我想感谢所有回答了我的问题并给出了解决上述问题的替代方法的人。
但是,在实际使用R(安装软件包并运行一些R脚本)之前,由于内存不足,您必须增加Raspberry Pi的交换文件大小(此服务的工作原理与窗口中的页面文件非常相似,当RAM使用率很高时)。您可以通过在LX终端中输入以下命令来编辑配置文件之一来配置它。
sudo nano /etc/dphys-swapfile
CONF_SWAPSIZE=100 #(change 100 to 512 or 1024, up to you, save the file)
sudo /etc/init.d/dphys-swapfile stop
sudo /etc/init.d/dphys-swapfile start #(restart swap file service with new swap file size)
不过请注意,有些用户认为交换文件大小的增加实际上会破坏您的SD卡。因此,应用此更改需要您自担风险。我已经用这种配置为我的R自动化系统运行Pi了1个月了。到目前为止没有问题。希望这会有所帮助。
编辑:如果您使用的是B / B +型,我建议先配置交换文件的大小,然后编译R。
如何在DEBIAN WHEEZY上将r-base 2.15更新到3.x
deb http://cran.revolutionanalytics.com/bin/linux/debian wheezy-cran3/
deb-src http://cran.revolutionanalytics.com/bin/linux/debian wheezy-cran3/
gpg --keyserver pgpkeys.mit.edu --recv-key 06F90DE5381BA480
gpg -a --export 06F90DE5381BA480 | sudo apt-key add -
apt-get update
aptitude -t wheezy-cran3 install r-base r-base-dev