简体   繁体   English

在Linux上的RStudio中安装软件包时遇到问题

[英]Trouble installing packages in RStudio on Linux

I'm trying to install the following package in RStudio on Linux. 我正在尝试在Linux上的RStudio中安装以下软件包。 I'm getting the follow error code. 我收到以下错误代码。 I don't really understand it. 我不太了解 I was wondering if anyone could help me make sense of it. 我想知道是否有人可以帮助我理解这一点。

Thanks, Nick 谢谢,尼克

> install.packages("PKI")
Installing package into ‘/home/nick/R/x86_64-pc-linux-gnu-library/3.4’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/src/contrib/PKI_0.1-3.tar.gz'
Content type 'application/x-gzip' length 31058 bytes (30 KB)
==================================================
downloaded 30 KB

* installing *source* package ‘PKI’ ...
** package ‘PKI’ successfully unpacked and MD5 sums checked
** libs
gcc -I/usr/include/R/ -DNDEBUG   -D_FORTIFY_SOURCE=2   -fpic  -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong  -c asn1.c -o asn1.o
gcc -I/usr/include/R/ -DNDEBUG   -D_FORTIFY_SOURCE=2   -fpic  -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong  -c init.c -o init.o
gcc -I/usr/include/R/ -DNDEBUG   -D_FORTIFY_SOURCE=2   -fpic  -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong  -c pki-x509.c -o pki-x509.o
pki-x509.c: In function ‘PKI_extract_key’:
pki-x509.c:136:26: error: dereferencing pointer to incomplete type ‘EVP_PKEY {aka struct evp_pkey_st}’
     if (EVP_PKEY_type(key->type) != EVP_PKEY_RSA)
                          ^~
pki-x509.c: In function ‘get_cipher’:
pki-x509.c:244:40: error: dereferencing pointer to incomplete type ‘EVP_CIPHER_CTX {aka struct evp_cipher_ctx_st}’
  ctx = (EVP_CIPHER_CTX*) malloc(sizeof(*ctx));
                                        ^~~~
pki-x509.c: In function ‘PKI_RSAkeygen’:
pki-x509.c:550:5: warning: ‘RSA_generate_key’ is deprecated [-Wdeprecated-declarations]
     rsa = RSA_generate_key(bits, 65537, 0, 0);
     ^~~
In file included from /usr/include/openssl/rsa.h:13:0,
                 from pki.h:13,
                 from pki-x509.c:1:
/usr/include/openssl/rsa.h:193:1: note: declared here
 DEPRECATEDIN_0_9_8(RSA *RSA_generate_key(int bits, unsigned long e, void
 ^
make: *** [/usr/lib64/R/etc/Makeconf:159: pki-x509.o] Error 1
ERROR: compilation failed for package ‘PKI’
* removing ‘/home/nick/R/x86_64-pc-linux-gnu-library/3.4/PKI’
Warning in install.packages :
  installation of package ‘PKI’ had non-zero exit status

The downloaded source packages are in
    ‘/tmp/RtmpttDG6C/downloaded_packages’

I think I had the same problem recently. 我想我最近有同样的问题。

I installed the package by downloading the most recent tarball (the .tar.gz file PKI_0.1-5.tar.gz ) from the PKI RForge page and then running 我通过从PKI RForge页面下载最新的tarball(.tar.gz文件PKI_0.1-5.tar.gz )来安装软件包,然后运行

install.packages(<tarball_path>, repos = NULL, type = "source") . install.packages(<tarball_path>, repos = NULL, type = "source")

EDIT: Actually, it's easier to run install.packages('PKI',,'http://www.rforge.net/') as written in small print at the bottom of the PKI RForge page 编辑:实际上,按照PKI RForge页面底部的小字体编写,运行install.packages('PKI',,'http://www.rforge.net/')更容易。

EDIT2: Looking at the news , it looks like version 0.1-4 (perhaps more stable) also fixes the problem and, well enough, it works on my system, while 0.1-3 doesn't (the one on CRAN currently). EDIT2:查看新闻 ,看来0.1-4版本(也许更稳定)也解决了这个问题,而且,足够好,它可以在我的系统上运行,而0.1-3不能(目前在CRAN上运行)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM