2017-04-24 94 views
7

我對R編程完全陌生。我正在使用這個網站作爲參考。 http://r4ds.had.co.nz/introduction.html 但無法安裝軟件包。請幫我解決一下這個。使用依賴= TRUE並沒有幫助..install.packages中的警告:'tidyverse'包的安裝具有非零退出狀態

installing *source* package ‘curl’ ... 
** package ‘curl’ successfully unpacked and MD5 sums checked 
Package libcurl was not found in the pkg-config search path. 
Perhaps you should add the directory containing `libcurl.pc' 
to the PKG_CONFIG_PATH environment variable 
No package 'libcurl' found 
Package libcurl was not found in the pkg-config search path. 
Perhaps you should add the directory containing `libcurl.pc' 
to the PKG_CONFIG_PATH environment variable 
No package 'libcurl' found 
Using PKG_CFLAGS= 
Using PKG_LIBS=-lcurl 
------------------------- ANTICONF ERROR --------------------------- 
Configuration failed because libcurl was not found. Try installing: 
* deb: libcurl4-openssl-dev (Debian, Ubuntu, etc) 
* rpm: libcurl-devel (Fedora, CentOS, RHEL) 
* csw: libcurl_dev (Solaris) 
If libcurl is already installed, check that 'pkg-config' is in your 
PATH and PKG_CONFIG_PATH contains a libcurl.pc file. If pkg-config 
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via: 
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...' 
-------------------------------------------------------------------- 
ERROR: configuration failed for package ‘curl’ 
* removing ‘/home/akriti/R/x86_64-pc-linux-gnu-library/3.2/curl’ 
Warning in install.packages : 
    installation of package ‘curl’ had non-zero exit status 
* installing *source* package ‘openssl’ ... 
** package ‘openssl’ successfully unpacked and MD5 sums checked 
Using PKG_CFLAGS= 
Using PKG_LIBS=-lssl -lcrypto 
------------------------- ANTICONF ERROR --------------------------- 
Configuration failed because openssl was not found. Try installing: 
* deb: libssl-dev (Debian, Ubuntu, etc) 
* rpm: openssl-devel (Fedora, CentOS, RHEL) 
* csw: libssl_dev (Solaris) 
* brew: [email protected] (Mac OSX) 
If openssl is already installed, check that 'pkg-config' is in your 
PATH and PKG_CONFIG_PATH contains a openssl.pc file. If pkg-config 
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via: 
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...' 
-------------------------------------------------------------------- 
ERROR: configuration failed for package ‘openssl’ 
* removing ‘/home/akriti/R/x86_64-pc-linux-gnu-library/3.2/openssl’ 
Warning in install.packages : 
    installation of package ‘openssl’ had non-zero exit status 
* installing *source* package ‘evaluate’ ... 
** package ‘evaluate’ successfully unpacked and MD5 sums checked 
** R 
** preparing package for lazy loading 
** help 
*** installing help indices 
** building package indices 
** testing if installed package can be loaded 
* DONE (evaluate) 
* installing *source* package ‘highr’ ... 
** package ‘highr’ successfully unpacked and MD5 sums checked 
** R 
** inst 
** preparing package for lazy loading 
** help 
*** installing help indices 
** building package indices 
** installing vignettes 
** testing if installed package can be loaded 
* DONE (highr) 
* installing *source* package ‘markdown’ ... 
** package ‘markdown’ 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 Rbase64.c -o Rbase64.o 
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 Rinit.c -o Rinit.o 
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 Rmarkdown.c -o Rmarkdown.o 
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 autolink.c -o autolink.o 
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 buffer.c -o buffer.o 
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 houdini_href_e.c -o houdini_href_e.o 
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 houdini_html_e.c -o houdini_html_e.o 
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 html.c -o html.o 
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 html_smartypants.c -o html_smartypants.o 
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 markdown.c -o markdown.o 
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 stack.c -o stack.o 
gcc -std=gnu99 -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o markdown.so Rbase64.o Rinit.o Rmarkdown.o autolink.o buffer.o houdini_href_e.o houdini_html_e.o html.o html_smartypants.o markdown.o stack.o -L/usr/lib/R/lib -lR 
installing to /home/akriti/R/x86_64-pc-linux-gnu-library/3.2/markdown/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 (markdown) 
* installing *source* package ‘yaml’ ... 
** package ‘yaml’ successfully unpacked and MD5 sums checked 
** libs 
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I. -DNDEBUG  -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c api.c -o api.o 
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I. -DNDEBUG  -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c dumper.c -o dumper.o 
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I. -DNDEBUG  -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c emitter.c -o emitter.o 
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I. -DNDEBUG  -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c implicit.c -o implicit.o 
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I. -DNDEBUG  -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c loader.c -o loader.o 
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I. -DNDEBUG  -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c parser.c -o parser.o 
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I. -DNDEBUG  -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c r-ext.c -o r-ext.o 
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I. -DNDEBUG  -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c reader.c -o reader.o 
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I. -DNDEBUG  -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c scanner.c -o scanner.o 
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I. -DNDEBUG  -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c writer.c -o writer.o 
gcc -std=gnu99 -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o yaml.so api.o dumper.o emitter.o implicit.o loader.o parser.o r-ext.o reader.o scanner.o writer.o -L/usr/lib/R/lib -lR 
installing to /home/akriti/R/x86_64-pc-linux-gnu-library/3.2/yaml/libs 
** R 
** inst 
** preparing package for lazy loading 
** help 
*** installing help indices 
** building package indices 
** testing if installed package can be loaded 
* DONE (yaml) 
* installing *source* package ‘htmltools’ ... 
** package ‘htmltools’ successfully unpacked and MD5 sums checked 
** libs 
g++ -I/usr/share/R/include -DNDEBUG -I"/home/akriti/R/x86_64-pc-linux-gnu-library/3.2/Rcpp/include" -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c RcppExports.cpp -o RcppExports.o 
g++ -I/usr/share/R/include -DNDEBUG -I"/home/akriti/R/x86_64-pc-linux-gnu-library/3.2/Rcpp/include" -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c template.cpp -o template.o 
g++ -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o htmltools.so RcppExports.o template.o -L/usr/lib/R/lib -lR 
installing to /home/akriti/R/x86_64-pc-linux-gnu-library/3.2/htmltools/libs 
** R 
** preparing package for lazy loading 
** help 
*** installing help indices 
** building package indices 
** testing if installed package can be loaded 
* DONE (htmltools) 
* installing *source* package ‘base64enc’ ... 
** package ‘base64enc’ 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 base64.c -o base64.o 
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 uriencode.c -o uriencode.o 
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 utf8.c -o utf8.o 
gcc -std=gnu99 -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o base64enc.so base64.o uriencode.o utf8.o -L/usr/lib/R/lib -lR 
installing to /home/akriti/R/x86_64-pc-linux-gnu-library/3.2/base64enc/libs 
** R 
** preparing package for lazy loading 
** help 
*** installing help indices 
** building package indices 
** testing if installed package can be loaded 
* DONE (base64enc) 
* installing *source* package ‘xml2’ ... 
** package ‘xml2’ successfully unpacked and MD5 sums checked 
Package libxml-2.0 was not found in the pkg-config search path. 
Perhaps you should add the directory containing `libxml-2.0.pc' 
to the PKG_CONFIG_PATH environment variable 
No package 'libxml-2.0' found 
Package libxml-2.0 was not found in the pkg-config search path. 
Perhaps you should add the directory containing `libxml-2.0.pc' 
to the PKG_CONFIG_PATH environment variable 
No package 'libxml-2.0' found 
Using PKG_CFLAGS= 
Using PKG_LIBS=-lxml2 
------------------------- ANTICONF ERROR --------------------------- 
Configuration failed because libxml-2.0 was not found. Try installing: 
* deb: libxml2-dev (Debian, Ubuntu, etc) 
* rpm: libxml2-devel (Fedora, CentOS, RHEL) 
* csw: libxml2_dev (Solaris) 
If libxml-2.0 is already installed, check that 'pkg-config' is in your 
PATH and PKG_CONFIG_PATH contains a libxml-2.0.pc file. If pkg-config 
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via: 
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...' 
-------------------------------------------------------------------- 
ERROR: configuration failed for package ‘xml2’ 
* removing ‘/home/akriti/R/x86_64-pc-linux-gnu-library/3.2/xml2’ 
Warning in install.packages : 
    installation of package ‘xml2’ had non-zero exit status 
* installing *source* package ‘caTools’ ... 
** package ‘caTools’ successfully unpacked and MD5 sums checked 
** libs 
g++ -I/usr/share/R/include -DNDEBUG  -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c Gif2R.cpp -o Gif2R.o 
g++ -I/usr/share/R/include -DNDEBUG  -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c GifTools.cpp -o GifTools.o 
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 runfunc.c -o runfunc.o 
g++ -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o caTools.so Gif2R.o GifTools.o runfunc.o -L/usr/lib/R/lib -lR 
installing to /home/akriti/R/x86_64-pc-linux-gnu-library/3.2/caTools/libs 
** R 
** preparing package for lazy loading 
** help 
*** installing help indices 
** building package indices 
** testing if installed package can be loaded 
* DONE (caTools) 
* installing *source* package ‘rprojroot’ ... 
** package ‘rprojroot’ successfully unpacked and MD5 sums checked 
** R 
** inst 
** preparing package for lazy loading 
** help 
*** installing help indices 
** building package indices 
** installing vignettes 
** testing if installed package can be loaded 
* DONE (rprojroot) 
ERROR: dependencies ‘curl’, ‘openssl’ are not available for package ‘httr’ 
* removing ‘/home/akriti/R/x86_64-pc-linux-gnu-library/3.2/httr’ 
Warning in install.packages : 
    installation of package ‘httr’ had non-zero exit status 
* installing *source* package ‘knitr’ ... 
** package ‘knitr’ successfully unpacked and MD5 sums checked 
** R 
** demo 
** inst 
** preparing package for lazy loading 
** help 
*** installing help indices 
** building package indices 
** installing vignettes 
** testing if installed package can be loaded 
* DONE (knitr) 
ERROR: dependencies ‘xml2’, ‘httr’ are not available for package ‘rvest’ 
* removing ‘/home/akriti/R/x86_64-pc-linux-gnu-library/3.2/rvest’ 
Warning in install.packages : 
    installation of package ‘rvest’ had non-zero exit status 
* installing *source* package ‘rmarkdown’ ... 
** package ‘rmarkdown’ successfully unpacked and MD5 sums checked 
** R 
** inst 
** preparing package for lazy loading 
** help 
*** installing help indices 
** building package indices 
** testing if installed package can be loaded 
* DONE (rmarkdown) 
ERROR: dependencies ‘httr’, ‘rvest’, ‘xml2’ are not available for package ‘tidyverse’ 
* removing ‘/home/akriti/R/x86_64-pc-linux-gnu-library/3.2/tidyverse’ 
Warning in install.packages : 
*installation of package ‘tidyverse’ had non-zero exit status 
+0

你使用什麼版本的R?什麼OS? – MrFlick

+0

Ubuntu或Windows? –

+0

我在Ubuntu上使用R版本:3.2.3 – Akriti

回答

15

你在你的錯誤信息找到了答案:

------------------------ ANTICONF ERROR --------------------------- 
Configuration failed because libcurl was not found. Try installing: 
* deb: libcurl4-openssl-dev (Debian, Ubuntu, etc) 
.... 
.... 

複製並粘貼以下到終端和比再次嘗試安裝tidyverse。應該解決問題。

# Required for many packages 
sudo apt-get install -y libxml2-dev libcurl4-openssl-dev libssl-dev 
+0

爲什麼這個答案不被接受? –

0

發生該問題的原因tidyverse具有系統依賴性(即,libcurl4-openssl-devlibssl-devlibxml2-dev)。這是一個blog post,更詳細地解釋瞭解決方案。

相關問題