在R中安装PKI包时出错。

4

我希望在RPubs上发布一个slidify演示文稿,但需要安装PKI和rsconnect包。

在尝试安装R中的PKI包时,我遇到了这个错误消息。

Installing package into ‘/home/juanchi/R/x86_64-pc-linux-gnu-library/3.2’
(as ‘lib’ is unspecified)
probando la URL 'http://cran.rstudio.com/src/contrib/PKI_0.1-1.tar.gz'
Content type 'application/x-gzip' length 20334 bytes (19 KB)
==================================================
downloaded 19 KB

* installing *source* package ‘PKI’ ...
** package ‘PKI’ successfully unpacked and MD5 sums checked
** libs
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c asn1.c -o asn1.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c init.c -o init.o
In file included from init.c:1:0:
pki.h:11:25: fatal error: openssl/err.h: No existe el archivo o el directorio
 #include <openssl/err.h>
                         ^
compilation terminated.
/usr/lib/R/etc/Makeconf:134: recipe for target 'init.o' failed
make: *** [init.o] Error 1
ERROR: compilation failed for package ‘PKI’
* removing ‘/home/juanchi/R/x86_64-pc-linux-gnu-library/3.2/PKI’
Warning in install.packages :
  installation of package ‘PKI’ had non-zero exit status

使用此会话信息:

> sessionInfo()
R version 3.2.0 (2015-04-16)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 15.04

locale:
 [1] LC_CTYPE=pt_BR.UTF-8       LC_NUMERIC=C               LC_TIME=pt_BR.UTF-8       
 [4] LC_COLLATE=es_ES.UTF-8     LC_MONETARY=pt_BR.UTF-8    LC_MESSAGES=es_ES.UTF-8   
 [7] LC_PAPER=pt_BR.UTF-8       LC_NAME=C                  LC_ADDRESS=C              
[10] LC_TELEPHONE=C             LC_MEASUREMENT=pt_BR.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] devtools_1.8.0

loaded via a namespace (and not attached):
 [1] httr_0.6.1        magrittr_1.5      rversions_1.0.0   htmltools_0.2.6   tools_3.2.0      
 [6] RCurl_1.95-4.7    yaml_2.1.13       memoise_0.2.1     stringi_0.4-1     rmarkdown_0.6.2.2
[11] git2r_0.10.1      stringr_1.0.0     digest_0.6.8      bitops_1.0-6      XML_3.98-1.1    

有人知道这里发生了什么吗?


1
你的机器上安装了OpenSSL头文件吗? - user3710546
为您的操作系统安装其中一个openssl-devel软件包。 - hrbrmstr
5
我支持@hrbrmstr的评论。安装 sudo apt-get install libssl-dev,因为你显然是在Ubuntu上操作。 - user3710546
@Pascal 谢谢!那就是重点..然后我用 devtools::install_github("s-u/pki") 完成了。 - Juanchi
2个回答

6
在Ubuntu上,为了安装SSL的头文件,您需要安装libssl-dev
sudo apt-get install libssl-dev
或通过Synaptic安装。
最好也安装libcurl4-openssl-dev,我上次检查时需要这个相关的RCurl包。

我确认在Ubuntu 18.04和R 3.5.1上可以运行。安装了libssl-dev之后,我可以执行install.packages("PKI")而没有出现错误。 - stragu

0

我有同样的问题,但是针对RHEL。我使用了sudo yum install openssl-devel,问题解决了!


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接