所以我一直在尝试安装Shiny和Devtools R软件包,但是我遇到了同样的错误:无论什么类型的软件包总是有一个非零退出并包含“错误:未知输入名称'FILE'“消息。一个例子如下。为了记录,我已经运行了apt-get更新和升级命令,尝试重新安装R和RStudio等,但我一直遇到这个问题。
这是我的/etc/apt/sources.list:
#deb cdrom:[Linux Mint 18.1 _Serena_ - Release amd64 20161213]/ xenial contrib main non-free
deb http://cran.rstudio.com/bin/linux/ubuntu xenial/
deb https://cloud.r-project.org/bin/linux/ubuntu xenial/
我坚持这个,任何人都可以帮我弄清楚如何正确安装这些R包吗?我没有运气通过RStudio的IDE或通过CLI尝试...这里缺少什么?????
install.packages("tibble")
Installing package into ‘/home/lennys/R/x86_64-pc-linux-gnu-library/3.3’
(as ‘lib’ is unspecified)
also installing the dependency ‘lazyeval’
trying URL 'https://cloud.r-project.org/src/contrib/lazyeval_0.2.0.tar.gz'
Content type 'application/x-gzip' length 317272 bytes (309 KB)
==================================================
downloaded 309 KB
trying URL 'https://cloud.r-project.org/src/contrib/tibble_1.2.tar.gz'
Content type 'application/x-gzip' length 54517 bytes (53 KB)
==================================================
downloaded 53 KB
* installing *source* package ‘lazyeval’ ...
** package ‘lazyeval’ successfully unpacked and MD5 sums checked
** libs
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c expr.c -o expr.o
In file included from expr.c:3:0:
/usr/share/R/include/Rinternals.h:1042:48: error: unknown type name ‘FILE’
void R_InitFileInPStream(R_inpstream_t stream, FILE *fp,
^
/usr/share/R/include/Rinternals.h:1045:50: error: unknown type name ‘FILE’
void R_InitFileOutPStream(R_outpstream_t stream, FILE *fp,
^
/usr/lib/R/etc/Makeconf:132: recipe for target 'expr.o' failed
make: *** [expr.o] Error 1
ERROR: compilation failed for package ‘lazyeval’
* removing ‘/home/lennys/R/x86_64-pc-linux-gnu-library/3.3/lazyeval’
ERROR: dependency ‘lazyeval’ is not available for package ‘tibble’
* removing ‘/home/lennys/R/x86_64-pc-linux-gnu-library/3.3/tibble’
The downloaded source packages are in
‘/tmp/RtmpvLx4dw/downloaded_packages’
Warning messages:
1: In install.packages("tibble") :
installation of package ‘lazyeval’ had non-zero exit status
2: In install.packages("tibble") :
installation of package ‘tibble’ had non-zero exit status
>
更多信息:我一直试图解决这个问题,但仍然没有成功。我一再看到这个:
In file included from print_stderr.c:2:0:
/usr/share/R/include/Rinternals.h:1042:48: error: unknown type name ‘FILE’
void R_InitFileInPStream(R_inpstream_t stream, FILE *fp,
^
/usr/share/R/include/Rinternals.h:1045:50: error: unknown type name ‘FILE’
void R_InitFileOutPStream(R_outpstream_t stream, FILE *fp,
我没有答案,但我只能告诉你
FILE
是一个非常普通的老C,真的应该知道然后,首先要做的事情是:你是否安装了r-base-dev
软件包,以确保满足一系列其他依赖性?
最后,从我的Ubuntu 16.10笔记本电脑登录:
edd@brad:~$ install.r tibble
trying URL 'https://cloud.r-project.org/src/contrib/tibble_1.2.tar.gz'
Content type 'application/x-gzip' length 54517 bytes (53 KB)
==================================================
downloaded 53 KB
* installing *source* package ‘tibble’ ...
** package ‘tibble’ successfully unpacked and MD5 sums checked
** libs
ccache g++ -I/usr/share/R/include -DNDEBUG -I"/usr/local/lib/R/site-library/Rcpp/include" -fpic -g -O3 -Wall -pipe -Wno-unused -pedantic -march=native -c RcppExports.cpp -o RcppExports.o
ccache g++ -I/usr/share/R/include -DNDEBUG -I"/usr/local/lib/R/site-library/Rcpp/include" -fpic -g -O3 -Wall -pipe -Wno-unused -pedantic -march=native -c matrixToDataFrame.cpp -o matrixToDataFrame.o
g++ -Wl,-S -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o tibble.so RcppExports.o matrixToDataFrame.o -L/usr/lib/R/lib -lR
installing to /usr/local/lib/R/site-library/tibble/libs
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
* DONE (tibble)
The downloaded source packages are in
‘/tmp/downloaded_packages’
edd@brad:~$
标准建议:也许在r-sig-debian上询问其他Mint用户潜伏在那里。
我已经这么做了很长时间才知道如果我想安装RStudio&R,那么最好先检查并找出如何事先。所以当查询(ubuntu mint 16.10 rstudio install apt-get)没有返回任何类似可用答案的内容时,我并不感到惊讶。因此,我进行了调查,并设法偶然发现以下URL,这些URL明确表达了问题,并描述了一个命令行解决方案,以使功能和工作正常运行。
如果这已经解决了,那会很酷,但我的感觉是因为固有的Yak Shaving(http://sethgodin.typepad.com/seths_blog/2005/03/dont_shave_that.html)SNAFU级别与Ubuntu v16.04到v16.10的非功能性一样,这些修复说明仍然可行,并可能作为一个非常好的模板,用于修复类似于其他软件包的问题。
干杯,odoncaoa
我正在运行Mint 18.1,刚刚安装了R:
sudo apt-get install r-base r-base-dev
(我猜测只是“r-base-dev”就足够了。)
作为非root用户,我然后启动r
并输入:
install.packages('tibble')
它询问了镜像,我选择了一个地理位置接近的镜像,它询问我是否要创建一个本地存储库(而不是系统存储库),我说是的。
我的输出与你的不同:
also installing the dependencies ‘rlang’, ‘Rcpp’
trying URL 'https://cran.ma.imperial.ac.uk/src/contrib/rlang_0.1.1.tar.gz'
Content type 'application/x-gzip' length 201419 bytes (196 KB)
==================================================
downloaded 196 KB
trying URL 'https://cran.ma.imperial.ac.uk/src/contrib/Rcpp_0.12.11.tar.gz'
Content type 'application/x-gzip' length 2485092 bytes (2.4 MB)
==================================================
downloaded 2.4 MB
trying URL 'https://cran.ma.imperial.ac.uk/src/contrib/tibble_1.3.3.tar.gz'
Content type 'application/x-gzip' length 91511 bytes (89 KB)
==================================================
downloaded 89 KB
即tibble是版本1.3.3,而不是1.2,而rcpp和rlang是依赖项,而不是lazyeval。但我怀疑这与你得到的错误信息有关,更多的是与2月到6月之间发生变化的事情有关。
我从另一个答案看到你放弃并重新安装了操作系统(Mint / Ubuntu差异不会导致你看到的错误)。我怀疑一个不那么极端的解决方案就是卸载r并重新安装,确保它是你安装的'r-base-dev'。如果它继续,卸载并重新安装'gcc',因为抱怨FILE
是一个标志,C编译器安装严重搞砸了。
我有同样的问题,我已经解决了:
然后,重新安装R: