我是新的Ubuntu用户。
当我尝试使用install.packages()时出现此错误。在这种情况下,我尝试了install.packages(' h2o'):
gcc: error: unrecognized command line option ‘-fstack-protector-strong’
gcc: error: unrecognized command line option ‘-Wdate-time’
/usr/lib/R/etc/Makeconf:159: recipe for target 'base64.o' failed
make: *** [base64.o] Error 1
ERROR: compilation failed for package ‘RCurl’
* removing ‘/usr/local/lib/R/site-library/RCurl’
Warning in install.packages :
installation of package ‘RCurl’ had non-zero exit status
ERROR: dependency ‘RCurl’ is not available for package ‘h2o’
* removing ‘/usr/local/lib/R/site-library/h2o’
Warning in install.packages :
installation of package ‘h2o’ had non-zero exit status
我将向您展示其他类似案例,install.packages(' purrr'):
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
gcc: error: unrecognized command line option ‘-fstack-protector-strong’
gcc: error: unrecognized command line option ‘-Wdate-time’
/usr/lib/R/etc/Makeconf:159: recipe for target 'expr.o' failed
make: *** [expr.o] Error 1
ERROR: compilation failed for package ‘lazyeval’
* removing ‘/usr/local/lib/R/site-library/lazyeval’
Warning in install.packages :
installation of package ‘lazyeval’ had non-zero exit status
ERROR: dependency ‘lazyeval’ is not available for package ‘purrr’
* removing ‘/usr/local/lib/R/site-library/purrr’
Warning in install.packages :
installation of package ‘purrr’ had non-zero exit status
The downloaded source packages are in
‘/tmp/RtmpYokw4O/downloaded_packages’
或install.packages(' zoo')
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I../inst/include -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c coredata.c -o coredata.o
gcc: error: unrecognized command line option ‘-fstack-protector-strong’
gcc: error: unrecognized command line option ‘-Wdate-time’
/usr/lib/R/etc/Makeconf:159: recipe for target 'coredata.o' failed
make: *** [coredata.o] Error 1
ERROR: compilation failed for package ‘zoo’
* removing ‘/usr/local/lib/R/site-library/zoo’
Warning in install.packages :
installation of package ‘zoo’ had non-zero exit status
The downloaded source packages are in
‘/tmp/RtmpYokw4O/downloaded_packages’
我已经环顾四周,但我发现的一切都失败了。
我也知道可以通过
来解决问题sudo apt-get install r-cran-ggplot2
有没有办法通过install.packages('')安装软件包?